Description
Calling player.error() after disposal throws because Player#error() calls addClass('vjs-error') after the player element has been cleared.
Reduced test case
https://codepen.io/philippde/pen/RNKMmNL
Steps to reproduce
<!doctype html>
<video id="player" class="video-js"></video>
<script type="module">
import videojs from 'video.js';
const player = videojs('player');
player.dispose();
player.error(3);
</script>
Errors
TypeError: Cannot read properties of null (reading 'classList')
at addClass
at Player.addClass
at Player.error
What version of Video.js are you using?
8.23.9
Video.js plugins used.
No response
What browser(s) including version(s) does this occur with?
Firefox 152.0.5
What OS(es) and version(s) does this occur with?
Mac OS 26.5.1
Description
Calling
player.error()after disposal throws becausePlayer#error()callsaddClass('vjs-error')after the player element has been cleared.Reduced test case
https://codepen.io/philippde/pen/RNKMmNL
Steps to reproduce
Errors
What version of Video.js are you using?
8.23.9
Video.js plugins used.
No response
What browser(s) including version(s) does this occur with?
Firefox 152.0.5
What OS(es) and version(s) does this occur with?
Mac OS 26.5.1