3

Is it possible for a Chromecast receiver to determine a particular sender's URL?

I can get a list of senders:

const context = cast.framework.CastReceiverContext.getInstance();
context.getSenders();

This returns an object like this:

{
  id: "01234567-8901-2345-6789-abcdefabcdef.0:160531083194132871",
  userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWeb…L, like Gecko) Chrome/86.0.4240.198 Safari/537.36"
}

However, this doesn't contain the URL of the sender. I need to figure out the URL of the site being cast from. Is this possible? And if so, how?

Brad
  • 159,648
  • 54
  • 349
  • 530
  • what do you mean "URL of the sender"? Based on the `userAgent`, the request was sent from a browser, what is URL of a browser? Btw, url is some kind of custom data, you can try `CastSession#sendMessage` called on sender side to do that. – Hoang Dao Nov 16 '20 at 08:15
  • I'm hoping to restrict usage of my receiver to certain sites. If other sites use it, I want to display a different message or styling. Therefore, I don't really want to use custom data for this if I can help it. But, if that's the only way, it will be sufficient. (This doesn't need to be a strong security measure.) Thanks. – Brad Nov 16 '20 at 16:08
  • if you know the appid: https://clients3.google.com/cast/chromecast/device/app?a={appid} – Endless Nov 30 '22 at 16:45

0 Answers0