Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set default play 480p? #103

Open
ghost opened this issue Nov 28, 2017 · 4 comments
Open

How to set default play 480p? #103

ghost opened this issue Nov 28, 2017 · 4 comments

Comments

@ghost
Copy link

ghost commented Nov 28, 2017

my code:

@ghost
Copy link
Author

ghost commented Nov 28, 2017

`

****`

@willyelns
Copy link

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
  }
]);

@ghost
Copy link
Author

ghost commented Jan 27, 2018

@willyelns Default resolution in using tags method。
Hi, how can I setup default resolution by using this method?
----For example I want to choose 720p as default resolution----

<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>

@selimatmaca
Copy link

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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants