2a9f2842 by Brandon Bay

Fixed issue with unit tests

Fake test playlists were breaking when they didn’t have segments.
1 parent 137cc11d
...@@ -248,6 +248,10 @@ videojs.Hls.prototype.src = function(src) { ...@@ -248,6 +248,10 @@ videojs.Hls.prototype.src = function(src) {
248 the current time to go along with it. 248 the current time to go along with it.
249 */ 249 */
250 videojs.Hls.getMediaIndexForLive = function(selectedPlaylist) { 250 videojs.Hls.getMediaIndexForLive = function(selectedPlaylist) {
251 if (!selectedPlaylist.segments) {
252 return 0;
253 }
254
251 var tailIterator = selectedPlaylist.segments.length, 255 var tailIterator = selectedPlaylist.segments.length,
252 tailDuration = 0, 256 tailDuration = 0,
253 targetTail = (selectedPlaylist.targetDuration || 10) * 3; 257 targetTail = (selectedPlaylist.targetDuration || 10) * 3;
......