Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retrieve media info from the current track being played on a specific Chromecast

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!

like image 372
Molkobain Avatar asked May 08 '19 22:05

Molkobain


People also ask

Is there any Chromecast history?

Can You See History on Chromecast? The Chromecast itself doesn't store a historical log or record of what's been played on the device. Simply put: There isn't a menu you can look through to see viewing history on Chromecast.

How do I stop Chromecast from playing current videos?

Type in chrome://flags/ in the Chrome search bar. In the newly opened window, search for Global Media Controls for Cast. By default, “Default” will be the preset option. Change it to “Disabled” to disable the feature.

Can Chromecast be tracked?

If a device is running without GPS, Google can still precisely track its location. Even in a densely populated area, Google can still pinpoint the location with just a few feet of difference in distance. This location data is what hackers obtain from Google Home or Chromecast, says Young's research.


1 Answers

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

like image 165
Anjaneesh Rayapati Avatar answered Oct 11 '22 22:10

Anjaneesh Rayapati