This repository has been archived by the owner on Dec 10, 2020. It is now read-only.
Moved 'loadstarted' setting to fix networkState #106
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1300 and #1341 -- controls don't show when auto playing with Flash
In a previous change we moved the
loadstart
event to be fired early to match html5 more closely (it's fired as soon as there is a source basically, even if preload=none). This made it so the event might fire before the object is registered with the player, making it so loadstart is never fired, vjs-has-started is never added as a class, and controls don't show.This is similar to html5 element in that we might miss the loadstart event, and we address that by checking the networkState value. If it's not zero, loadstart was already fired.
The Flash swf has a networkState value, but was returning zero even after loadstart was fired, so that's what this fixes. It moves the loadstarted=true to right before the loadstart event is fired, so that networkState returns greater than zero after that.
@seniorflexdeveloper, @dmlap, @gkatsev -- I'd appreciate a second set of eyes on this (rather urgent) patch. There's other places where loadstarted is checked, and I want to make sure I'm not introducing new errors by moving it to earlier. For instance, it looks like there's a few places where loadstarted is checked to determine if a netstream function should be called, and after this fix we're setting loadstarted to true before netstream is initialized. I can't tell if that's going to be a problem.