Skip to content

Commit

Permalink
fix(FEC-8688): When pausing video in cast and then disconnect the pla…
Browse files Browse the repository at this point in the history
…yer display first play poster and not video stream with paused point (#200)


Let the player always autoplay and pause it if necessary
  • Loading branch information
Dan Ziv authored and OrenMe committed Jan 23, 2019
1 parent ccd5124 commit 6c8376a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/common/cast/remote-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,19 @@ function onRemoteDeviceDisconnected(payload: RemoteDisconnectedPayload): void {
if (snapshot) {
this.dispatchEvent(new FakeEvent(CastEventType.CAST_SESSION_ENDED));
const originPlaybackConfig = this.config.playback;
configurePlayback.call(this, snapshot.config.playback);
const shouldPause = !snapshot.config.playback.autoplay;
const mediaInfo = snapshot.mediaInfo;
snapshot.config.playback.autoplay = true;
configurePlayback.call(this, snapshot.config.playback);
if (mediaInfo) {
this.loadMedia(mediaInfo).then(() => {
this._eventManager.listenOnce(this, this.Event.Core.FIRST_PLAYING, () => {
this.textStyle = snapshot.textStyle;
configurePlayback.call(this, originPlaybackConfig);
setInitialTracks.call(this, snapshot);
if (shouldPause) {
this.pause();
}
});
});
}
Expand Down

0 comments on commit 6c8376a

Please sign in to comment.