Browse Source

Document the playlist bandwidth comparator

Add some information on how to use the playlistBandwidth function.
pull/80/head
David LaPalomento 12 years ago
parent
commit
0049b9c987
  1. 9
      src/videojs-hls.js

9
src/videojs-hls.js

@ -38,6 +38,15 @@ var
// temporary flucations in client bandwidth // temporary flucations in client bandwidth
bandwidthVariance = 1.1, bandwidthVariance = 1.1,
/**
* A comparator function to sort two playlist object by bandwidth.
* @param left {object} a media playlist object
* @param right {object} a media playlist object
* @return {number} Greater than zero if the bandwidth attribute of
* left is greater than the corresponding attribute of right. Less
* than zero if the bandwidth of right is greater than left and
* exactly zero if the two are equal.
*/
playlistBandwidth = function(left, right) { playlistBandwidth = function(left, right) {
var leftBandwidth, rightBandwidth; var leftBandwidth, rightBandwidth;
if (left.attributes && left.attributes.BANDWIDTH) { if (left.attributes && left.attributes.BANDWIDTH) {

Loading…
Cancel
Save