Skip to content
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
merged 3 commits into from
Jul 11, 2014

Conversation

heff
Copy link
Member

@heff heff commented Jul 11, 2014

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.

heff added a commit to heff/video.js that referenced this pull request Jul 11, 2014
…rmine if loadstart should be manually fired.

Previously this was only done in the HTML5 tech, but Flash needs it as well. This relies on videojs/video-js-swf#106.

Also removed the 'not implemented' warnings from the media tech functions. I think there's a better way we can help tech authors here, and it was blocking the ability to check if a function was implemented for real.

Fixes videojs#1300, fixes videojs#1341
@dmlap
Copy link
Member

dmlap commented Jul 11, 2014

This looks correct to me but I do not trust my own judgement when it comes to everything that's going on in HTTPVideoProvider. I'm preaching to the choir here, but that file needs to be rewritten.

@tomjohnson916
Copy link
Contributor

Looks good to me also. I would also concur w @dmlap comments on not being a fan of this class in its current state.

@heff
Copy link
Member Author

heff commented Jul 11, 2014

Thanks guys, going to pull this in.

We should also probably take some time to review long term options for the swf. It's definitely not very maintainable in it's current state.

@heff heff merged commit cda161f into videojs:stable Jul 11, 2014
paullryan pushed a commit to paullryan/video.js that referenced this pull request Jul 17, 2014
…rmine if loadstart should be manually fired.

Previously this was only done in the HTML5 tech, but Flash needs it as well. This relies on videojs/video-js-swf#106.

Also removed the 'not implemented' warnings from the media tech functions. I think there's a better way we can help tech authors here, and it was blocking the ability to check if a function was implemented for real.

Fixes videojs#1300, fixes videojs#1341
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants