silvermine / videojs-quality-selector

MIT License
183 stars 54 forks source link

Multiple source formats #38

Open b3wii opened 4 years ago

b3wii commented 4 years ago

This:

<video class="vjs-tech" poster="31813vpo_565751d1bdc0c66.jpg" preload="metadata" crossorigin="anonymous">
    <source src="web.mp4" type="video/mp4" label="480p" selected="true">
    <source src="web.ogv" type="video/ogg" label="480p" selected="true">
    <source src="web.webm" type="video/webm" label="480p" selected="true">
    <source src="web_720p.mp4" type="video/mp4" label="720p">
    <source src="web_720p.ogv" type="video/ogg" label="720p">
    <source src="web_720p.webm" type="video/webm" label="720p">
    <source src="web_1080p.mp4" type="video/mp4" label="1080p">
    <source src="web_1080p.ogv" type="video/ogg" label="1080p">
    <source src="web_1080p.webm" type="video/webm" label="1080p">
</video>

..results in this:

https://i.imgur.com/s1oNq18.png (one select option for every source element)

b3wii commented 4 years ago

For now i set src before calling player.controlBar.addChild('QualitySelector') but it would be nice if the script would check player.currentType() and only show those formats.

jthomerson commented 4 years ago

@b3wii your assessment sounds correct. Pull requests are welcome. Please make sure to read and comply with out coding standards to ensure your PR has the best chance of success