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

No media callbacks occurring #64

Open
jpetrocik opened this issue Dec 30, 2016 · 1 comment
Open

No media callbacks occurring #64

jpetrocik opened this issue Dec 30, 2016 · 1 comment

Comments

@jpetrocik
Copy link

I don't know if this a general issue or caused by the receiver applications I'm using, i.e. Youtube and Crackle, Netflix, Hulu.

When I send a pause, play, stop request the message returned doesn't contain the requestId and hence never triggers the callback.

Below are the sent and received messages:

castv2 send message: protocolVersion=0 sourceId=client-707282 destinationId=ea6126bb-5cd7-4d38-a844-03460f4d35a2 namespace=urn:x-cast:com.google.cast.media data={"type":"PAUSE","mediaSessionId":1927979685,"requestId":2}

castv2 recv message: protocolVersion=0 sourceId=ea6126bb-5cd7-4d38-a844-03460f4d35a2 destinationId=* namespace=urn:x-cast:com.google.cast.media data={"type":"MEDIA_STATUS","status":[{"mediaSessionId":1927979685,"playbackRate":1,"supportedMediaCommands":3,"volume":{"level":0.009999997913837433,"muted":false},"playerState":"PAUSED","customData":{"playerState":2},"currentTime":8.384}]}

In request-response.js the requestId is checked against the incoming message before calling the callback.

if(response.requestId === requestId) {
  self.removeListener('message', onmessage);

Any thoughts about how to trigger the callback in this situation?

@germasch
Copy link

I'm also seeing the same problem with the Youtube and GoogleMusic apps, and I'm being kinda annoyed by it. FWIW, it works correctly with the DefaultMediaReceiver.

I guess the only workaround I can think of is to listen to the status messages and react once I see that the status has changed (e.g., from PLAYING -> PAUSED), and call a callback then.

I find it kinda odd, though, that messages don't get acknowledged as they're supposed to. I suppose the official interfaces probably don't care much (press the pause button -> send pause; get a status with state "PAUSED" -> show pause status), as they don't really care what caused the status change, they just show whatever the latest status is.

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

2 participants