You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to determine the resolution of the currently playing Level, but sometimes the level object doesn't contain width or height fields. Where can I find this information?
You can get videoWidth and videoHeight from the video tag:
>hlsjs.media.videoWidth1280
The challenge is sometimes hls.js fires LEVEL_SWITCHED or FRAG_CHANGED right before the size of the video changes. So you're actually better off listening to video.onresize and then getting currentLevel from hlsjs.
Also note that width and height are populated in levels when your parent manifest contains the required RESOLUTION attribute. If you are playing a chunked playlist or missing that attribute you'll need to check the video tag.
I'm trying to determine the resolution of the currently playing
Level
, but sometimes the level object doesn't containwidth
orheight
fields. Where can I find this information?results in
qualityChange undefinedxundefined
.it depends on the stream, sometimes it's there, other times not.
The text was updated successfully, but these errors were encountered: