vime
vime copied to clipboard
feat: add auto-aspect ratio for Hls streams
Feature Request
Vime version: 5.0.31
Describe the Feature Request
At least one of the existing providers (Vimeo) provides an automatic aspect ratio. It would be nice to have this for HLS streams too, since they could plausibly change aspect ratio mid-stream or between different levels.
Describe Preferred Solution
We can easily get the video width and height out of the Level object in the hls.js API. It should be a simple matter of listening to the LEVEL_SWITCHED event, calculating the updated aspect ratio from hls.currentLevel and dispatching the new value.
A boolean prop should probably be offered on the Hls component to turn this behaviour on or off.
Describe Alternatives
None.
Related Code
Additional Context
I plan to make a PR for this feature, but would welcome any suggestions before I do so.