diff --git a/src/js/media/html5.js b/src/js/media/html5.js index eb4b41218..03cbf30d7 100644 --- a/src/js/media/html5.js +++ b/src/js/media/html5.js @@ -24,6 +24,9 @@ vjs.Html5 = vjs.MediaTechController.extend({ // HTML video is able to automatically resize when going to fullscreen this.features['fullscreenResize'] = true; + // HTML video supports progress events + this.features['progressEvents'] = true; + vjs.MediaTechController.call(this, player, options, ready); this.setupTriggers(); diff --git a/src/js/media/media.js b/src/js/media/media.js index 40cf3d084..ae42037da 100644 --- a/src/js/media/media.js +++ b/src/js/media/media.js @@ -172,19 +172,6 @@ vjs.MediaTechController.prototype.manualProgressOn = function(){ // Trigger progress watching when a source begins loading this.trackProgress(); - - // Watch for a native progress event call on the tech element - // In HTML5, some older versions don't support the progress event - // So we're assuming they don't, and turning off manual progress if they do. - // As opposed to doing user agent detection - this.one('progress', function(){ - - // Update known progress support for this playback technology - this.features['progressEvents'] = true; - - // Turn off manual progress tracking - this.manualProgressOff(); - }); }; vjs.MediaTechController.prototype.manualProgressOff = function(){ diff --git a/test/unit/media.js b/test/unit/media.js index 139f5072d..46c128702 100644 --- a/test/unit/media.js +++ b/test/unit/media.js @@ -4,6 +4,7 @@ module('Media Tech', { 'setup': function() { clock = sinon.useFakeTimers(); features = videojs.util.mergeOptions({}, videojs.MediaTechController.prototype.features); + videojs.MediaTechController.prototype.features['progressEvents'] = false; }, 'teardown': function() { clock.restore(); @@ -114,29 +115,3 @@ test('should synthesize progress events by default', function() { clock.tick(500); equal(progresses, 1, 'triggered one event'); }); - -test('stops progress events if the tech produces them natively', function() { - var end = 0, buffered = 0, progresses = 0, tech; - tech = new videojs.MediaTechController({ - id: noop, - on: noop, - // progress will be detected any time it is queried - bufferedPercent: function() { - return buffered++; - }, - trigger: function(event) { - if (event === 'progress') { - progresses++; - } - } - }); - - // simulate a native progress event - tech.trigger('progress'); - tech.on('progress', function() { - progresses++; - }); - - clock.tick(10 * 1000); - equal(progresses, 0, 'did not simulate progress'); -});