Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

Fixing InvalidStateError in Win10 IE11 #1230

Merged
merged 4 commits into from
Aug 15, 2017
Merged
Changes from 2 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
4 changes: 3 additions & 1 deletion src/playback-watcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ export default class PlaybackWatcher {
this.tech_.on('seekablechanged', fixesBadSeeksHandler);
this.tech_.on('waiting', waitingHandler);
this.tech_.on(timerCancelEvents, cancelTimerHandler);
this.monitorCurrentTime_();
if (this.tech_.hasStarted_ || this.tech_.isReady_) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the tech is not ready by the time this constructor runs, this will continue to be broken. You should setup an event listener for the ready event instead of checking the private variables on the tech. The tech has a this.tech_.ready() function that will either setup a listener for when the ready event will be fired, or will run your callback immediately if the tech is already ready.

this.monitorCurrentTime_();
}

// Define the dispose function to clean up our events
this.dispose = () => {
Expand Down