mirror of
https://github.com/kmoskwiak/videojs-resolution-switcher.git
synced 2025-10-05 10:49:28 +02:00
redme update
This commit is contained in:
parent
3103da56f7
commit
68f485f21c
1 changed files with 31 additions and 1 deletions
32
README.md
32
README.md
|
@ -51,7 +51,37 @@ Or use `<source>` tags:
|
|||
|
||||
```
|
||||
|
||||
There's also a [working example](example.html) of the plugin you can check out if you're having trouble.
|
||||
## Source options
|
||||
|
||||
Sources can passed to player using `updateSrc` method or `<source>` tag as shown above. Avalible options for each source are:
|
||||
* label - `String` (required) is shown in menu (ex. 'SD' or '360p')
|
||||
* res - `Number` is resolution of video used for sorting (ex. 360 or 1080)
|
||||
|
||||
## Plugin options
|
||||
|
||||
You can pass options to plugin like this:
|
||||
|
||||
```javascript
|
||||
|
||||
videojs('video', {
|
||||
controls: true,
|
||||
muted: true,
|
||||
width: 1000,
|
||||
plugins: {
|
||||
videoJsResolutionSwitcher: {
|
||||
default: 'low'
|
||||
}
|
||||
}
|
||||
}, function(){
|
||||
// this is player
|
||||
})
|
||||
```
|
||||
### Avalible options:
|
||||
* default - `{Number}|'low'|'high'` - default resolution. If any `Number` is passed plugin will try to choose source based on `res` parameter. If `low` or `high` is passed, plugin will choose respectively worse or best resolution (if `res` parameter is specified). If `res` parameter is not specified plugin assumes that sources array is sorted from best to worse.
|
||||
|
||||
## Example
|
||||
|
||||
[Working example](example.html) of the plugin you can check out if you're having trouble.
|
||||
|
||||
## Methods
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue