Skip to content

Commit

Permalink
fix: early play should wait for player ready, even if source is avail…
Browse files Browse the repository at this point in the history
…able (#4134)

Fixes #4057
  • Loading branch information
gkatsev authored Mar 2, 2017
1 parent 6874fa2 commit 3bbf019
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -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_ ||
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 3bbf019

Please sign in to comment.