This plugin provides Viblast Player quality menu control to Video.js framework.
Switch branches/tags
Nothing to show
Clone or download
Latest commit 28c4b24 Sep 4, 2016
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example Removed audio example Sep 4, 2016
LICENSE Initial version Sep 3, 2016
README.md Fixed http/https issues Sep 3, 2016
bower.json Initial version Sep 3, 2016
package.json Initial version Sep 3, 2016
videojs.viblast-menu.css Initial version Sep 3, 2016
videojs.viblast-menu.js Initial version Sep 3, 2016

README.md

This plugin provides Viblast Player quality menu control to Video.js framework.

Example

Visit http://viblast.github.io/videojs-viblast-menu/example

Usage

  • Include the plugin after viblast.js:
<link rel="stylesheet" href="http://vjs.zencdn.net/5.9.2/video-js.css">

<script type="text/javascript" src="http://vjs.zencdn.net/5.9.2/video.js"></script>

<script type="text/javascript" src="https://cdn.viblast.com/vb/stable/viblast.js"></script>

<link rel="stylesheet" href="viblast-menu-plugin.css">
<script type="text/javascript" src="videojs.viblast-menu.js"></script>
  • Or just type bower install videojs-viblast-menu --save

  • Add "ViblastQualityMenu" to the Video.js plugins object:

    plugins: {
    	ViblastQualityMenu: {
    	}

By default the plugin creates labels for each variant of the playlist. The labels are generated based on the presence playlist information in the following order:

  • Bandwidth
  • Resolution
  • Internal Id

Options

This is possible to provide custom label generator for audio and video streams:

...
createCustomQualityVideoLabel = function(quality,index) {
if (quality === 'auto') {
  return "auto";
}
return quality.width+"x"+quality.height;
}
....
plugins: {
  ViblastQualityMenu: {
  customLabel: {
    /*pass your own quality label creator function like this :*/
        audioStream:createCustomQualityAudioLabel,
        videoStream:createCustomQualityVideoLabel,
        default:createCustomQualityDefaultLabel
      }

    }
  }

When the plugin receives the quality information it calls the functions passed as arguments in its setup. Different functions for different types of streams can be passed. The functions are called with two arguments: Quality and Index. The quality object contains the information contained in the playlist/manifest about the variant - Bandwidth, width and height. The index contains the position of the variant definition within the playlist.