-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
5.0.0-rc.12 - wait for components to register before autoSetup #2341
Comments
If you remove I'm not sure if there's an easy way we can make the data-setup magic smarter, or if it's worth it. Does document ready wait for async scripts? |
If I remove async (in the head), I get videojs is undefined (they all load in parallel). If I have the async attribute (or at the end of the page), the autoSetup is triggered before the component is registred. I'm not sure what more we can do outside waiting for the entire page to be loaded. This is a major problem. Maybe we can wait for the page to be ready before loading the tech? I don't know. |
That doesn't seem right to me. By definition I think we do need a better system for including plugins in the load process though. Some way of informing data-setup to wait. Either that or deprecating the data-setup method. |
The same issue to my case, and the example doesn't work at least on Mac OS X Chrome 47.0.2526.80 (64-bit), iOS 9.2 Safari and Mac OS X Safari ver. 9.0.1 (10601.2.7.2).
Confirmed the issue also with videojs 4.12.11. I guess, because video.js execution / evaluation takes much time, autoSetupTimeout comes before the parser reaches Youtube tech and the tech is registered, though scripts are non-async and they are executed in-order. I need a workaround for this issue but I don't want the |
@qpSHiNqp This is most likely simply because your resources are not present. the naming of all these things have changed over time quite often. The following just works for me: 4.12.15 and youtube tech plugin v1.2.13 And here an updated jsbin with 5.4.4 (prerelease) and youtube tech 2.0.3 |
@hartman Oh, I wasn't aware of that! Thank you and I confirmed those examples work fine. |
Did Someone find a solution? |
If you need to do async loading, then you should also do the tracking to make sure those components are loaded and executed in order and then use the videojs() setup function. This is usually where AMD and CommonJS come into the picture. Without those technologies or ones like them, you should usually not use the async attribute on your scripts. There is a very nice article by Jake Archibald on html5rocks that gives lots of background about how script loading works. |
Video.js doesn't wait on the page to be loaded before doing the setup on the videojs instances (video with data-setup).
Thus, it doesn't wait for my Youtube component to register and if you are unlucky (or fake a really slow network), it will throw this error:
Here is how I am doing it:
The async is very important to make sure the loading order is intact (or it will throw videojs undefined). If I put my scripts at the end of the page, I have the same problem.
I am not very familiar with the way the autosetup work. Should we wait for the document ready state before? It might be necessary.
What do you guys think?
The text was updated successfully, but these errors were encountered: