-
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
Make sure it's safe to call bufferedPercent before the SWF loads #2289
Conversation
Manual time tracking calles bufferedPercent() on an interval and doesn't wait for the tech to be ready. If it's called before the SWF is loaded, it will throw an error. Make sure the methods required by bufferedPercent() don't throw if they're called early. Fixes videojs#2288.
LGTM |
lgtm. Should we just wrap every swf property call with a function that does this? |
After writing this commit, I wondered if it would be better to just wait for tech ready to start manual time tracking. @heff the only downside of that is we have to figure out a reasonable "default" value for each property, which isn't totally obvious (e.g. attributes that return Time Ranges, for instance). |
Ah, yeah, manual time tracking should definitely be waiting for tech ready. Though it doesn't hurt to also have this added protection built in. Do you want to add the former first or just move forward with this? Looks good to me either way. |
I'm ok with moving forward with this for now. I can file an issue to fix the latter so we don't forget about it. |
I can't help but note this sort of problem wouldn't exist if the base tech handled behavior before the official |
Yeah, I don't think anyone's arguing that's not a better direction, but what do you mean by the base tech? Should we try to make Tech handle all the defaults? |
LGTM |
Manual time tracking calles bufferedPercent() on an interval and doesn't wait for the tech to be ready. If it's called before the SWF is loaded, it will throw an error. Make sure the methods required by bufferedPercent() don't throw if they're called early. Fixes #2288.