From 405b29b8f194c4d5d29534eaf7ebd872486451cb Mon Sep 17 00:00:00 2001 From: mister-ben Date: Tue, 21 Feb 2017 20:48:45 +0000 Subject: [PATCH] fix: remove redundant Html5#play() play() is defined twice in Html5. The promise handling in the earlier one was moved into Player#play(). --- src/js/tech/html5.js | 13 ------------- test/unit/tech/html5.test.js | 17 ----------------- 2 files changed, 30 deletions(-) diff --git a/src/js/tech/html5.js b/src/js/tech/html5.js index 7f79f826a..9d36ab90b 100644 --- a/src/js/tech/html5.js +++ b/src/js/tech/html5.js @@ -341,19 +341,6 @@ class Html5 extends Tech { }); } - /** - * Called by {@link Player#play} to play using the `Html5` `Tech`. - */ - play() { - const playPromise = this.el_.play(); - - // Catch/silence error when a pause interrupts a play request - // on browsers which return a promise - if (playPromise !== undefined && typeof playPromise.then === 'function') { - playPromise.then(null, (e) => {}); - } - } - /** * Set current time for the `HTML5` tech. * diff --git a/test/unit/tech/html5.test.js b/test/unit/tech/html5.test.js index c7acf2686..8983ce989 100644 --- a/test/unit/tech/html5.test.js +++ b/test/unit/tech/html5.test.js @@ -647,23 +647,6 @@ QUnit.test('Html5#reset calls Html5.resetMediaElement when called', function(ass Html5.resetMediaElement = oldResetMedia; }); -QUnit.test('Exception in play promise should be caught', function() { - const oldEl = tech.el_; - - tech.el_ = { - play: () => { - return new Promise(function(resolve, reject) { - reject(new DOMException()); - }); - } - }; - - tech.play(); - QUnit.ok(true, 'error was caught'); - - tech.el_ = oldEl; -}); - test('When Android Chrome reports Infinity duration with currentTime 0, return NaN', function() { const oldIsAndroid = browser.IS_ANDROID; const oldIsChrome = browser.IS_CHROME;