mplayer
mplayer copied to clipboard
Timechange on Raspberry pi
ON raspberry pi 2, jessie version event Time is not fired because "A:" time change is sent to SDTERR instead of STDOUT so changing code like below, makes it better :)
onError: function(error) {
if(this.options.debug) {
console.log('stderr: ' + error);
}
data = error.toString();
if(data.indexOf('A:') > -1) {
var timeStart, timeEnd, time;
if(data.indexOf(' V:') !== -1) {
timeStart = data.indexOf(' V:') + 3;
timeEnd = data.indexOf(' A-V:');
} else {
timeStart = data.indexOf('A:') + 2;
timeEnd = data.indexOf(' (');
}
time = data.substring(timeStart, timeEnd).trim();
this.emit('timechange', time)
}
}
ENV: RPI 2, Jessie MPlayer2 2.0-728-g2c378c7-4+b1 (C) 2000-2012 MPlayer Team
Any update on that? I'm having the same issue on Raspberry pi2! That's the only way you can check if the player is still working on a file in case you don't get other event and no sound is playing, so that would be great to have it working :)
I'll look at it when I have some free time :) Wasn't a priority since I'm only using this to play radio streams on RPi (no need for timechange event) :)
No worries :)
I would realy appreciate it if this bug can be fixed! Thanks @dzasa for this solution, it works for me a pi3.
Thank you for your solution, dzasa ! This should really be fixed.
ENV: RasPi 3, Raspbian 8 (Jessy), MPlayer2 2.0-728-g2c378c7-4+b1, nodejs v7.9.0