Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timechange on Raspberry pi #4

Open
dzasa opened this issue Jan 21, 2016 · 5 comments
Open

Timechange on Raspberry pi #4

dzasa opened this issue Jan 21, 2016 · 5 comments
Assignees

Comments

@dzasa
Copy link

dzasa commented Jan 21, 2016

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

@gbxl
Copy link

gbxl commented Apr 2, 2016

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

@noodny noodny self-assigned this Apr 3, 2016
@noodny
Copy link
Owner

noodny commented Apr 3, 2016

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

@gbxl
Copy link

gbxl commented Apr 27, 2016

No worries :)

@n9iels
Copy link

n9iels commented Feb 25, 2017

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

@KoolKeith
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants