-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Manually adding UI creates duplicate video and controls elements #2073
Comments
Hi, @gscragg, thanks for reporting! If you're creating the UI object yourself, don't add the data attributes and the auto scan code won't touch it! Are you creating the object yourself because you have a custom layout? Does this help? Let me know if you have any questions :) |
Based on the example I posted, I am not using Is using the Overlay constructor considered bad form? Is their a better way to programmatically add shaka UI to a player? |
You're right. I remember adding the attributes as part of the autoscan process to facilitate mass cleanup of the DOM in our automated tests. |
@ismena, would it be preferable to use the programmatic setup after the 'shaka-ui-loaded' event fires on |
Oh! Sorry, the code base changed on me! You might want to wait until the 'shaka-ui-loaded' event has fired to create your UI object, though. It will ensure that shaka library has fully loaded and all the polyfills have been installed. |
Ok, I can probably do that. Thank you both for your responses. |
If an app uses the shaka.ui.Overlay constructor to create a UI before our auto-detection code runs, they end up with two UIs one on top of the other. I personally think anyone should be grateful to get an extra UI or two, but people complain for some reason. Closes #2073. Change-Id: I793b5a7d8b5092a9b65426f5994019fde75bf957
If I use the Overlay constructor to add a
shaka.ui.Overlay
to an existing player instance at page load, then the auto scanning code runs on the already UI-ed player (and container).Example player
Possible fixes:
The text was updated successfully, but these errors were encountered: