silvermine / videojs-quality-selector

MIT License
183 stars 54 forks source link

Getting the currently playing resolution #78

Open mrjackcitrus opened 2 years ago

mrjackcitrus commented 2 years ago

If a user selects a resolution, how can I know what resolution the current playback is? Is this possible? For example, obtaining the "label" of the currently playing clip.

As a (failed) workaround, I have a filename structure which includes the resolution. I tried using player.currentSrc() to give me the url of the currently playing video but this only returns the default video url and not the one that is necessarily playing after the resolution is switched.

This may or may not be a bug so thought I'd flag it here.

I'm using Video JS in conjunction with its official playlist plugin in case that makes any difference to the above observations.

Thanks.

Jazzman1976 commented 2 years ago

Need the same. We would like to show the current source label instead the gear icon on the button.

dennisbohn commented 1 year ago

Did you try player.currentSource() instead of player.currentSrc()?

It returns the source object. https://docs.videojs.com/Player.html#currentSource