Skip to content

Commit

Permalink
Merge pull request #1055 from bbc/20-fixup-autoplay
Browse files Browse the repository at this point in the history
Fixes #1018
  • Loading branch information
Dan Sparacio authored and Dan Sparacio committed Jan 25, 2016
2 parents 1680b08 + 56c7a92 commit 63fbf8d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/streaming/MediaPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ function MediaPlayer() {
} else {
streamController.loadWithManifest(source);
}
element.autoplay = true;
}

if (!autoPlay || (isPaused() && playbackInitiated)) {
Expand All @@ -207,6 +208,7 @@ function MediaPlayer() {
throw PLAYBACK_NOT_INITIALIZED_ERROR;
}
playbackController.pause();
element.autoplay = false;
}

function isPaused() {
Expand Down
1 change: 1 addition & 0 deletions src/streaming/controllers/PlaybackController.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ function PlaybackController() {

function onPlaybackEnded() {
log('Native video element event: ended');
element.autoplay = false;
stopUpdatingWallclockTime();
eventBus.trigger(Events.PLAYBACK_ENDED);
}
Expand Down
1 change: 0 additions & 1 deletion src/streaming/controllers/StreamController.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ function StreamController() {

function onCanPlay(/*e*/) {
canPlay = true;
startAutoPlay();
}

function onPlaybackError(e) {
Expand Down

0 comments on commit 63fbf8d

Please sign in to comment.