More player guards

This commit is contained in:
Chocobozzz
2026-07-16 13:52:35 +02:00
parent faf7b28cf2
commit a5d26fd542
2 changed files with 9 additions and 5 deletions
@@ -87,9 +87,11 @@ export class PauseBezel extends Component {
}
dispose () {
if (this.playerPauseHandler) this.player().off('pause', this.playerPauseHandler)
if (this.playerPlayHandler) this.player().off('play', this.playerPlayHandler)
if (this.videoChangeHandler) this.player().off('video-change', this.videoChangeHandler)
if (this.player()) {
if (this.playerPauseHandler) this.player().off('pause', this.playerPauseHandler)
if (this.playerPlayHandler) this.player().off('play', this.playerPlayHandler)
if (this.videoChangeHandler) this.player().off('video-change', this.videoChangeHandler)
}
super.dispose()
}
@@ -60,8 +60,10 @@ class PlaylistMenu extends Component {
this.el().removeEventListener('mouseenter', this.onMouseEnter)
this.el().removeEventListener('mouseleave', this.onMouseLeave)
this.player().off('userinactive', this.userInactiveHandler)
this.player().off('click', this.onPlayerCick)
if (this.player()) {
this.player().off('userinactive', this.userInactiveHandler)
this.player().off('click', this.onPlayerCick)
}
for (const item of this.menuItems) {
item.dispose()