Skip to content
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

How to check for video progress? #153

Open
MirrorTM opened this issue Oct 26, 2020 · 3 comments
Open

How to check for video progress? #153

MirrorTM opened this issue Oct 26, 2020 · 3 comments

Comments

@MirrorTM
Copy link

No description provided.

@MirrorTM
Copy link
Author

when loading a video i wish to wait until its fully loaded , however the loader doesnt report progress by onProgress.. how to manage this? cant find any documentation

@englercj
Copy link
Owner

I don't think we report individual resource load progress for anything that isn't XHR currently. PR welcome.

You'd need to implement it in here: https://github.com/englercj/resource-loader/blob/master/src/load_strategies/MediaElementLoadStrategy.ts
You can see how it works for XHR in here: https://github.com/englercj/resource-loader/blob/master/src/load_strategies/XhrLoadStrategy.ts
Here are the relevant MDN docs: https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/progress_event

@englercj
Copy link
Owner

englercj commented Oct 28, 2020

Oh actually, we don't report anything after "canplaythrough" because we consider that "done". The best thing to do here is probably create your own video element and use that. You can even pass it into resource loader if you want, depending on what you're actually doing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants