1
0
mirror of https://github.com/videojs/video.js.git synced 2025-03-17 21:18:27 +02:00

fix: early play should wait for player ready, even if source is available (#4134)

Fixes #4057
This commit is contained in:
Gary Katsevman 2017-03-02 11:15:06 -05:00 committed by GitHub
parent 6874fa2824
commit 3bbf0199e6

View File

@ -311,6 +311,9 @@ class Player extends Component {
// Run base component initializing with new options
super(null, options, ready);
// Turn off API access because we're loading a new tech that might load asynchronously
this.isReady_ = false;
// if the global option object was accidentally blown away by
// someone, bail early with an informative error
if (!this.options_ ||
@ -1613,7 +1616,7 @@ class Player extends Component {
});
// Only calls the tech's play if we already have a src loaded
} else if (this.src() || this.currentSrc()) {
} else if (this.isReady_ && (this.src() || this.currentSrc())) {
return this.techGet_('play');
} else {
this.ready(function() {