Chromecast event to disconnect device (sender)

Is there an event that the sending application will notify when the use selects "stop cast" from the internal chrome extension?

I have a chrome sender application that is in limbo state if the user decides to stop broadcasting from the extension instead of the application button.

EDIT: This is some code:

CastPlayer.prototype.onMediaDiscovered = function (how, mediaSession) {
  this.currentMediaSession = mediaSession;
  // ...    
  this.currentMediaSession.addUpdateListener(this.onMediaStatusUpdate.bind(this));
  // ...
};

CastPlayer.prototype.onMediaStatusUpdate = function (e) {
  console.log(e);
};
+3
source share
2 answers

Have you tried Session.addUpdateListener(listener)? I think the listener will be notified when the session is no longer alive.

+3
source

All Articles