Skip to content

Commit

Permalink
revert: Revert "fix: force autoplay in Chrome (#4804)"
Browse files Browse the repository at this point in the history
This reverts commit 6fe7a9a.
  • Loading branch information
gkatsev committed Mar 13, 2018
1 parent d2f63ad commit c7186ac
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 c7186ac

Please sign in to comment.