cbf5bc25 by Brandon Bay

Adhering to code style

Some syntactic changes to better align with code style standard
1 parent 3691572e
...@@ -110,7 +110,7 @@ videojs.Hls.prototype.handleSourceOpen = function() { ...@@ -110,7 +110,7 @@ videojs.Hls.prototype.handleSourceOpen = function() {
110 110
111 this.playlists.on('loadedmetadata', videojs.bind(this, function() { 111 this.playlists.on('loadedmetadata', videojs.bind(this, function() {
112 var selectedPlaylist, loaderHandler, oldBitrate, newBitrate, segmentDuration, 112 var selectedPlaylist, loaderHandler, oldBitrate, newBitrate, segmentDuration,
113 segmentDlTime, setupEvents, threshold; 113 segmentDlTime, setupEvents, threshold, tailIterator, tailDuration;
114 114
115 setupEvents = function() { 115 setupEvents = function() {
116 this.fillBuffer(); 116 this.fillBuffer();
...@@ -142,14 +142,14 @@ videojs.Hls.prototype.handleSourceOpen = function() { ...@@ -142,14 +142,14 @@ videojs.Hls.prototype.handleSourceOpen = function() {
142 } 142 }
143 143
144 // start live playlists 30 seconds before the current time 144 // start live playlists 30 seconds before the current time
145 if(this.duration() === Infinity && this.mediaIndex === 0 && selectedPlaylist.segments) { 145 if (this.duration() === Infinity && this.mediaIndex === 0 && selectedPlaylist.segments) {
146 var i = selectedPlaylist.segments.length - 1, 146 tailIterator = selectedPlaylist.segments.length - 1;
147 tailDuration = 0; 147 tailDuration = 0;
148 do { 148 while (tailDuration < 30 && tailIterator > 0) {
149 tailDuration += selectedPlaylist.segments[i].duration; 149 tailDuration += selectedPlaylist.segments[tailIterator].duration;
150 i--; 150 tailIterator--;
151 } while (tailDuration < 30 && i > 0); 151 }
152 this.mediaIndex = i; 152 this.mediaIndex = tailIterator;
153 } 153 }
154 154
155 // this threshold is to account for having a high latency on the manifest 155 // this threshold is to account for having a high latency on the manifest
......