KirovBvulgaru / google-cast-sdk

Automatically exported from code.google.com/p/google-cast-sdk
0 stars 0 forks source link

Getting current status of playing media #146

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
After using the built-in media player receiver app, I don't get updates on the 
current status of the media as it plays on the Chromecast. I've registered an 
updateListener callback but it only fires when I perform an action such as 
muting audio.

This also seems to be an issue in the example app, CastHelloVideo-chrome.
https://github.com/googlecast/CastHelloVideo-chrome

I'm not sure if I'm not doing something correctly, or if this is something that 
still needs to be added. I'd expect that the chrome.cast.media.Media would 
support getting the status, but I don't see anything metioned in the 
documentation.

I see that the media playback messages mention a GET_STATUS message, but I am 
unable to get it to work by calling session.sendMessage, when I attempt to send 
a message to the media player namespace, I get an invalid_parameter error, with 
null description.

Any help would be appreciated! :) Thanks for a great media player!

Original issue reported on code.google.com by cra...@gmail.com on 17 Feb 2014 at 11:33

GoogleCodeExporter commented 8 years ago
There used to an issue for message from receiver to get to sender app but it 
has been fixed.  See this: 
http://stackoverflow.com/questions/21566190/chrome-google-cast-sender-not-receiv
ing-media-status-updates-on-original-media-l.

 To verify that you have this issue, you can check that your message actually gets to Cast extension but not your sender app.  See Cast extension console log from it's background.html.  

If this is the case, you need to get the latest Cast extension.  Otherwise 
please provide more info.

Original comment by shawns...@google.com on 18 Feb 2014 at 1:37

GoogleCodeExporter commented 8 years ago

Original comment by anad...@google.com on 18 Feb 2014 at 7:01

GoogleCodeExporter commented 8 years ago
Hi folks,

I checked my extension, and it's at version 14.123.1.5.

The way to reproduce this is to check out the CastHelloVideo-chrome project, 
and play a video. The media update listener never gets called as the video 
plays. It is only called when the video is played/paused.

To double check that it wasn't a bug with the example, I ran the line on the 
console:
    currentMediaSession.addUpdateListener( function(){ console.log("media session update"); } )
and I only ever got a message when I clicked pause/play, and never just as the 
video was playing.

Am I not registering the right callback? What's the right way to get updated on 
the progress through the video as it's playing on the chromecast?

Thanks again.

Original comment by cra...@gmail.com on 19 Feb 2014 at 2:29

GoogleCodeExporter commented 8 years ago
Hi Craiig,

This is the correct behavior for now.  Currently receiver won't send status 
update during playing only when there is some event like pause/play.  

For continuous update like progress bar, you'd have to keep a timer in your 
sender app.  An example of this is provided in the CastVideos-chrome app.

We'll revisit this in next release and provide more hooks potentially.

Original comment by shawns...@google.com on 20 Feb 2014 at 6:55

GoogleCodeExporter commented 8 years ago
Ok! Thanks for the response! :)

Original comment by cra...@gmail.com on 20 Feb 2014 at 6:56

GoogleCodeExporter commented 8 years ago
Just a heads up.  There is a beta release of Cast extension, freshly released, 
which will provide a way to get current estimated time.   There will be more 
discussion on this in coming days on stackoverflow, github, G+ community, etc.  
:-)

Original comment by shawns...@google.com on 20 Feb 2014 at 8:29