-
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
JSMpeg.Player is much slower than HTML version #154
Comments
There shouldn't be any performance difference when instantiating JSMpeg directly in JavaScript. After all, the HTML tag uses it internally. Are there any errors in your browser's console? A way to get the player instance from the HTML tag is a good idea, though. I'll implement this. |
You can now get a reference to the player from the HTML element through document.addEventListener('DOMContentLoaded', function(){
var player = document.querySelector('.jsmpeg').playerInstance;
player.play();
}); |
Yeah, I agree, I also checked the code, there shouldn't be any difference. But it is actually different when I watch the video. I look closely, the visual size of the video of the js version is somehow bigger than the html version (it's like cover vs contain in css background size). And thanks for the player instance in html version, will be very useful. |
@phoboslab you have changed min.js version with more than one change, the another code added not work. |
When I use the HTML version:
It looks very good!
Then I want to control the video by API, so I changed to JS version
But it is very slow and laggy, my browser is Chrome. Why is that?
BTW, if I use the HTML version, can I get the instance from HTML element, so I can control via the API? Something like:
The text was updated successfully, but these errors were encountered: