Updates from code review
Showing
2 changed files
with
8 additions
and
3 deletions
... | @@ -556,7 +556,7 @@ videojs.Hls.prototype.fillBuffer = function(offset) { | ... | @@ -556,7 +556,7 @@ videojs.Hls.prototype.fillBuffer = function(offset) { |
556 | segmentUri; | 556 | segmentUri; |
557 | 557 | ||
558 | // if preload is set to "none", do not download segments until playback is requested | 558 | // if preload is set to "none", do not download segments until playback is requested |
559 | if (!player.hasClass('vjs-has-started') && player.options.preload === "none") { | 559 | if (!player.hasClass('vjs-has-started') && player.preload() === "none") { |
560 | return; | 560 | return; |
561 | } | 561 | } |
562 | 562 | ... | ... |
... | @@ -2300,13 +2300,18 @@ test('live stream should not call endOfStream', function(){ | ... | @@ -2300,13 +2300,18 @@ test('live stream should not call endOfStream', function(){ |
2300 | }); | 2300 | }); |
2301 | 2301 | ||
2302 | test('does not download segments if preload option set to none', function() { | 2302 | test('does not download segments if preload option set to none', function() { |
2303 | var loadedSegments = 0; | 2303 | var loadedSegments = 0, |
2304 | tech = player.el().querySelector('.vjs-tech'), | ||
2305 | properties = {}; | ||
2306 | |||
2304 | player.src({ | 2307 | player.src({ |
2305 | src: 'master.m3u8', | 2308 | src: 'master.m3u8', |
2306 | type: 'application/vnd.apple.mpegurl' | 2309 | type: 'application/vnd.apple.mpegurl' |
2307 | }); | 2310 | }); |
2308 | 2311 | ||
2309 | player.options.preload = "none"; | 2312 | tech.vjs_getProperty = function(property) { return properties[property] }; |
2313 | tech.vjs_setProperty = function(property, value) { properties[property] = value }; | ||
2314 | player.preload('none'); | ||
2310 | 2315 | ||
2311 | player.hls.loadSegment = function () { | 2316 | player.hls.loadSegment = function () { |
2312 | loadedSegments++; | 2317 | loadedSegments++; | ... | ... |
-
Please register or sign in to post a comment