mplayer icon indicating copy to clipboard operation
mplayer copied to clipboard

Timechange on Raspberry pi

Open dzasa opened this issue 9 years ago • 5 comments

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

dzasa avatar Jan 21 '16 18:01 dzasa

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 :)

gbxl avatar Apr 02 '16 21:04 gbxl

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) :)

noodny avatar Apr 03 '16 14:04 noodny

No worries :)

gbxl avatar Apr 27 '16 06:04 gbxl

I would realy appreciate it if this bug can be fixed! Thanks @dzasa for this solution, it works for me a pi3.

n9iels avatar Feb 25 '17 12:02 n9iels

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

KoolKeith avatar Sep 08 '17 18:09 KoolKeith