chromecast-java-api-v2
chromecast-java-api-v2 copied to clipboard
Listening for playback status changes?
Right now, if want to listen to playback changes (like pause/resume/stop) I have to continuously pool the ChromeCast#getMediaState() event. Is there a way I be notified of changes without pooling?
The best place to look for such answer is the official chromecast documentation. My guess is that you may be interested in spontaneous events sent by the chromecast device. Try to implement the ChromeCastSpontaneousEventListener interface and subscribe to such events via the registerListener method.
That's what I did, I receive notifications for example when an app is starting (or stopping) but I don't receive anything for playback status changes, only the Status event