Search code examples
androidchromecastgoogle-cast

Playing video ads on Chromecast


I'm trying to see if it's possible to play ads before/during a video on Chromecast from an Android sender. I understand that I can handle the logic on the receiver side and switch video src to play an ad, but how would I go about pausing the controller on the sender app so that it doesn't crash when video src is changed on the receiver? I've been looking through the docs but I really can't seem to find anything on this topic.

Thanks for the help


Solution

  • You have a couple of different options. I think the more appropriate one for your case is to have your receiver broadcast the changes on your receiver side to all the connected senders when a change happens so senders can adjust/update themselves; changes could be player status and metadata changes. For example, in a normal case, Sender A can start playback of movie A. Then while that is playing, Sender B, which is also connected, can start playing movie B. Then the Sender A will receive a media status and metadata updates informing it that the media has changes, so it can take the appropriate action, whatever it is. Your situation is not that different; handling on the sender side might be different based on your requirements.