mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2026-09-03 20:53:09 -05:00
More player guards
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user