e0b08967 by Brandon Bay Committed by David LaPalomento

Updates from code review

1 parent ae1590c7
......@@ -556,7 +556,7 @@ videojs.Hls.prototype.fillBuffer = function(offset) {
segmentUri;
// if preload is set to "none", do not download segments until playback is requested
if (!player.hasClass('vjs-has-started') && player.options.preload === "none") {
if (!player.hasClass('vjs-has-started') && player.preload() === "none") {
return;
}
......
......@@ -2300,13 +2300,18 @@ test('live stream should not call endOfStream', function(){
});
test('does not download segments if preload option set to none', function() {
var loadedSegments = 0;
var loadedSegments = 0,
tech = player.el().querySelector('.vjs-tech'),
properties = {};
player.src({
src: 'master.m3u8',
type: 'application/vnd.apple.mpegurl'
});
player.options.preload = "none";
tech.vjs_getProperty = function(property) { return properties[property] };
tech.vjs_setProperty = function(property, value) { properties[property] = value };
player.preload('none');
player.hls.loadSegment = function () {
loadedSegments++;
......