1
0
mirror of https://github.com/videojs/video.js.git synced 2024-11-28 08:58:46 +02:00

fix(player): reset CSS classes at player.reset (#8487)

Allows CSS classes to be reset when `player.reset` is called,
so that the player is close to its initial state.

- remove `vjs-playing`
- add `vjs-paused`
This commit is contained in:
André 2023-12-04 20:18:11 +01:00 committed by GitHub
parent 5f4aa91ef9
commit 849098f6c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -3599,6 +3599,10 @@ class Player extends Component {
if (this.tech_) {
this.tech_.clearTracks('text');
}
this.removeClass('vjs-playing');
this.addClass('vjs-paused');
this.resetCache_();
this.poster('');
this.loadTech_(this.options_.techOrder[0], null);

View File

@ -1911,6 +1911,8 @@ QUnit.test('player#reset loads the Html5 tech and then techCalls reset', functio
techOrder: ['html5', 'youtube']
},
error() {},
addClass() {},
removeClass() {},
resetCache_() {},
loadTech_(tech, source) {
loadedTech = tech;
@ -1944,6 +1946,8 @@ QUnit.test('player#reset loads the first item in the techOrder and then techCall
techOrder: ['youtube', 'html5']
},
error() {},
addClass() {},
removeClass() {},
resetCache_() {},
loadTech_(tech, source) {
loadedTech = tech;