mirror of
https://github.com/kmoskwiak/videojs-resolution-switcher.git
synced 2025-10-03 09:49:21 +02:00
readme, version
This commit is contained in:
parent
940c95ae67
commit
26fd89ecb0
3 changed files with 49 additions and 17 deletions
58
README.md
58
README.md
|
@ -1,4 +1,4 @@
|
|||
# Video.js Test
|
||||
# Video.js Resolution Switcher
|
||||
|
||||
A revolutionary plugin for video.js
|
||||
|
||||
|
@ -7,27 +7,61 @@ A revolutionary plugin for video.js
|
|||
Once you've added the plugin script to your page, you can use it with any video:
|
||||
|
||||
```html
|
||||
<video id='video'></video>
|
||||
<script src="video.js"></script>
|
||||
<script src="videojs-resolution-switcher.js"></script>
|
||||
<script>
|
||||
videojs(document.querySelector('video')).test();
|
||||
videojs('video', {
|
||||
controls: true
|
||||
}, function(){
|
||||
|
||||
// Add dynamically sources via newVideoSources method
|
||||
player.newVideoSources([
|
||||
{
|
||||
src: 'http://media.xiph.org/mango/tears_of_steel_1080p.webm',
|
||||
type: 'video/webm',
|
||||
label: '360'
|
||||
},
|
||||
{
|
||||
src: 'http://mirrorblender.top-ix.org/movies/sintel-1024-surround.mp4',
|
||||
type: 'video/mp4',
|
||||
label: '720'
|
||||
}
|
||||
])
|
||||
|
||||
player.on('resolutionchange', function(){
|
||||
console.info('Source changed to %s', player.src())
|
||||
})
|
||||
|
||||
}).videoJsResolutionSwitcher();
|
||||
</script>
|
||||
```
|
||||
|
||||
There's also a [working example](example.html) of the plugin you can check out if you're having trouble.
|
||||
|
||||
## Documentation
|
||||
### Plugin Options
|
||||
## Methods
|
||||
|
||||
You may pass in an options object to the plugin upon initialization. This
|
||||
object may contain any of the following properties:
|
||||
|
||||
#### option
|
||||
Type: `boolean`
|
||||
Default: true
|
||||
### newVideoSources([source])
|
||||
|
||||
An example boolean option that has no effect.
|
||||
```javascript
|
||||
|
||||
// Update video sources
|
||||
player.newVideoSources([
|
||||
{ type: "video/mp4", src: "http://www.example.com/path/to/video.mp4", label: 'SD' },
|
||||
{ type: "video/mp4", src: "http://www.example.com/path/to/video.mp4", lable: 'HD' },
|
||||
{ type: "video/mp4", src: "http://www.example.com/path/to/video.mp4", label: '4k' }
|
||||
])
|
||||
|
||||
```
|
||||
#### PARAMETERS:
|
||||
* source `Array` array of sources
|
||||
|
||||
|
||||
## Events
|
||||
|
||||
### resolutionchange `EVENT`
|
||||
|
||||
> Fired when resolution is changed
|
||||
|
||||
## Release History
|
||||
|
||||
- 0.1.0: Initial release
|
||||
|
|
|
@ -56,8 +56,6 @@
|
|||
}
|
||||
])
|
||||
|
||||
window.player = player;
|
||||
|
||||
player.on('resolutionchange', function(){
|
||||
console.info('Source changed to %s', player.src())
|
||||
})
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"name": "videojs-test",
|
||||
"version": "0.0.0",
|
||||
"name": "videojs-resolution-switcher",
|
||||
"version": "0.1.0",
|
||||
"author": "Kasper Moskwiak",
|
||||
"description": "A revolutionary plugin for video.js",
|
||||
"description": "Resolution switcher for video.js 5",
|
||||
"license": "Apache-2.0",
|
||||
"keywords": [
|
||||
"videojs",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue