chromecast-java-api-v2 icon indicating copy to clipboard operation
chromecast-java-api-v2 copied to clipboard

Listening for playback status changes?

Open vinz243 opened this issue 6 years ago • 2 comments

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?

vinz243 avatar Oct 22 '19 20:10 vinz243

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.

vitalidze avatar Oct 22 '19 22:10 vitalidze

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

vinz243 avatar Oct 23 '19 12:10 vinz243