6

I'm working on a webpage controling what is being played on a specific Chromecast (there are several on the network) but I'm having trouble with the Google Cast SDK.

I don't want a sender app, nor register a for an API key, just retrieve the media info currently being played.

On an Android smartphone, you get those information automatically as a notification, or directly in the Google Home application as you can see in the 2 screenshots below, even if you are not the one broadcasting the media.

Automatic notification From Google Home app

This topic is talking about something similar for an Android app, but I didn't find any similar notions in the Chrome Sender API (javascript).

Using the Chrome Sender API, I'm able to load a media on the chosen chromecast through a basic web app but that's not what I'm looking for. In the online documentation I did not find anything about this particular use case.

FYI the things I have:

  • ReceiverApplicationId casting to the chromecast
  • Chromecast IP / Name / Mac address

Does any of you have an idea how I could do that? Thanks!

Molkobain
  • 1,457
  • 1
  • 12
  • 17
  • 1
    Can you add any details like: code used, error problem encountered? [How do I ask a good question?](http://stackoverflow.com/help/how-to-ask), [How to create a Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve) Show the community what you have tried. – Jessica Rodriguez May 09 '19 at 11:05
  • Hi Jess, made some modifications, hope it's more clear now. – Molkobain May 09 '19 at 11:47

1 Answers1

1

Please check this: cast.framework.CastContext.getInstance().getCurrentSession().getMediaSession() which has everything for the currently playing content including a media object which includes: https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MediaInfo