Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Mar 2, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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