- var time = state.time.split(':');
- window['ui_mpc_seekcur'].max = time[1];
- window['ui_mpc_seekcur'].value = time[0];
+ var time;
+ if ('time' in state)
+ // When stopped, there is no time field at all.
+ time = state.time.split(':');
+ else
+ time = [0, 0];
+ window.ui_mpc_seekcur.max = time[1];
+ window.ui_mpc_seekcur.value = time[0];
+ percent = Math.floor((0.0 + time[0]) * 100 / (0.0 + time[1]));
+ window.ui_mpc_seekcur.title = 'seekcur (' + percent + '%)';
+
+ window.ui_mpc_setvol.value = state.volume;
+ window.ui_mpc_setvol.title = 'setvol (' + state.volume + '%)';