Open ghost opened 6 years ago
`
****`
Just define it on options:
var player = videojs('player');
player.videoJsResolutionSwitcher({
default: 480,
dynamicLabel: true
});
player.updateSrc([{
src: 'https://vjs.zencdn.net/v/oceans.mp4',
type: 'video/mp4',
label: '1080p',
res: 1080
},
{
src: 'https://vjs.zencdn.net/v/oceans.mp4',
type: 'video/mp4',
label: '720p',
res: 720
},
{
src: 'https://vjs.zencdn.net/v/oceans.mp4',
type: 'video/mp4',
label: '480p',
res: 480
}
]);
@willyelns Default resolution in using
<video id="video" class="video-js vjs-default-skin" width="1000" controls data-setup='{}'>
<source src="http://example.com/360p.mp4" type='video/mp4' label='360p' res='360' />
<source src="http://example.com/480p.mp4" type='video/mp4' label='480p' res='480' />
<source src="http://example.com/720p.mp4" type='video/mp4' label='720P' res='720' />
</video>
<script>
videojs('video').videoJsResolutionSwitcher()
</script>
You can change res value like below to change the sorting of the resolutions. This modification will not effect you labels and everything will look nicely nd 720p will be the default one. res='720' to res='1' res='480' to res='2' res='360' to res='3'
my code: