Skip to content

Commit

Permalink
revert: Revert "fix: force autoplay in Chrome (#4804)" (#5009)
Browse files Browse the repository at this point in the history
This reverts commit 6fe7a9a.

The PR #4804, which fixes #4720, causes a regression #5005. When testing for the regression, the original issue is no longer reproducible so the fix should be backed out. If someone is still using the old version of chrome and seeing the behavior of #4720, they can continue using the versions of Video.js that contain the fixed made in #4804: 6.5.2, 6.6x, 6.7.x.

Fixes #5005.
  • Loading branch information
gkatsev committed Mar 13, 2018
1 parent d2f63ad commit 8d86afd
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions src/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,6 @@ class Player extends Component {
this.changingSrc_ = false;
this.playWaitingForReady_ = false;
this.playOnLoadstart_ = null;

this.forceAutoplayInChrome_();
}

/**
Expand Down Expand Up @@ -2616,29 +2614,11 @@ class Player extends Component {
if (value !== undefined) {
this.techCall_('setAutoplay', value);
this.options_.autoplay = value;
this.ready(this.forceAutoplayInChrome_);
return;
}
return this.techGet_('autoplay', value);
}

/**
* chrome started pausing the video when moving in the DOM
* causing autoplay to not continue due to how Video.js functions.
* See #4720 for more info.
*
* @private
*/
forceAutoplayInChrome_() {
if (this.paused() &&
// read from the video element or options
(this.autoplay() || this.options_.autoplay) &&
// only target desktop chrome
(browser.IS_CHROME && !browser.IS_ANDROID)) {
this.play();
}
}

/**
* Set or unset the playsinline attribute.
* Playsinline tells the browser that non-fullscreen playback is preferred.
Expand Down

0 comments on commit 8d86afd

Please sign in to comment.