-
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
Proposed solution for issue #656 - "Default flag not working on tracks" #1153
Conversation
…n tracks (subtitles, captions)" Added additional check to look for auto preload option to avoid loading external captions, subtitles, etc. file on default
Nice, thanks! So the breaking tests is actually that we have another tests that sets auto play to true and a track with default true. The way I would actually fix that one is to change The way this is being implemented isn't really ideal. It requires one of the control elements to handle the default track behavior. If controls were disabled or removed, this would stop working. The preferred way to fix this would be to uncomment this line. The dirty hack way to fix the issue would be to put a settimeout around the track.show call.
I think we could accept that solution for now, along with a comment pointing to this note. This issue has been outstanding for awhile. Would you be interest in updating your PR to do that instead? The long term way to fix this I think would be to make the textTrackDisplay an actual part of a tech, so that it's ready when the tech is. @mmcc and I have already talked about doing that, and relying more on the browser's captions support at the same time. Another way to fix this might be to wait for all child elements to be loaded before triggering ready on the player. I think that could be done, and probably should be anyway. |
…orking on tracks (subtitles, captions)"" This reverts commit 8735935.
…allow default tracks to be shown appropriately. Added setTimeout workaround so that exception is not thrown because of html5 tech issue. Removed "default" attribute from player unit test so that track does not try to load extern during validation.
@heff Thanks for your quick response. I have updated my PR with your suggested changes. I modified the player unit test to not specifically pass the "default" option but rather "attrtest" to make sure it was passed through. I also reverted the original fix and then uncommented the existing default track code in the addTextTrack function (found here https://github.com/videojs/video.js/blob/v4.5.2/src/js/tracks.js#L61) as suggested. Essentially, adding the quick and dirty hack to get it all working. For the long term, if you or @mmcc will point me in the right direction for implementing the textTrackDisplay as part of the tech then I'd be happy to give it a go. |
This looks great, thanks!! Pulling this in. Moving captions handling to the tech I think is going to be difficult, but you're welcome to take a stab at it. A first step might be to make it possible to determine if captions are supported by the current video element, and if so, allow the track info to be passed through. It'd probably be easier to address the waiting for children to load issue. Right now we just trigger ready on the player whenever a new tech is loaded and ready, but we could add in a step to wait for children as well. |
Proposed solution for issue #656 - "Default flag not working on tracks"
Added additional check to look for auto preload option to avoid loading external captions, subtitles, etc. file on default
Thanks @Korotkiewicz for finding solution.