mirror of
https://github.com/videojs/video.js.git
synced 2024-12-04 10:34:51 +02:00
fix: reset() should null check the controlBar (#7692)
Fixes #7689 Co-authored-by: alex <try2betheb3st@gmail.com> Co-authored-by: Pat O'Neill <pgoneill@gmail.com>
This commit is contained in:
parent
054329899b
commit
7e2b9ec411
@ -3605,7 +3605,7 @@ class Player extends Component {
|
||||
resetProgressBar_() {
|
||||
this.currentTime(0);
|
||||
|
||||
const { durationDisplay, remainingTimeDisplay } = this.controlBar;
|
||||
const { durationDisplay, remainingTimeDisplay } = this.controlBar || {};
|
||||
|
||||
if (durationDisplay) {
|
||||
durationDisplay.updateContent();
|
||||
|
@ -2066,6 +2066,24 @@ QUnit.test('player#reset removes remote text tracks', function(assert) {
|
||||
log.warn.restore();
|
||||
});
|
||||
|
||||
QUnit.test('player#reset progress bar', function(assert) {
|
||||
|
||||
let error;
|
||||
|
||||
const player = TestHelpers.makePlayer();
|
||||
|
||||
player.removeChild('controlBar');
|
||||
player.controlBar = null;
|
||||
|
||||
try {
|
||||
player.resetProgressBar_();
|
||||
} catch (e) {
|
||||
error = e;
|
||||
}
|
||||
|
||||
assert.notOk(error, 'Function did not throw an error on resetProgressBar');
|
||||
});
|
||||
|
||||
QUnit.test('Remove waiting class after tech waiting when timeupdate shows a time change', function(assert) {
|
||||
const player = TestHelpers.makePlayer();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user