1
0
mirror of https://github.com/videojs/video.js.git synced 2025-01-04 06:48:49 +02:00

fix: remove redundant Html5#play()

play() is defined twice in Html5. The promise handling in the earlier one was moved into Player#play().
This commit is contained in:
mister-ben 2017-02-21 20:48:45 +00:00 committed by Gary Katsevman
parent e1b48042dd
commit 405b29b8f1
2 changed files with 0 additions and 30 deletions

View File

@ -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.
*

View File

@ -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;