]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/assets/player/playlist/playlist-menu.ts
Handle unavailable videos in embed playlists
[github/Chocobozzz/PeerTube.git] / client / src / assets / player / playlist / playlist-menu.ts
index 7d7d9e12f11cb996b1cddaed4be2f0f1b236e2e2..37284fb44ae558d670d8ac15157c2bdd8194a1d2 100644 (file)
@@ -11,8 +11,18 @@ class PlaylistMenu extends Component {
   constructor (player: videojs.Player, options?: PlaylistPluginOptions) {
     super(player, options as any)
 
-    this.player().on('userinactive', () => {
-      this.close()
+    const self = this
+
+    function userInactiveHandler () {
+      self.close()
+    }
+
+    this.el().addEventListener('mouseenter', () => {
+      this.player().off('userinactive', userInactiveHandler)
+    })
+
+    this.el().addEventListener('mouseleave', () => {
+      this.player().one('userinactive', userInactiveHandler)
     })
 
     this.player().on('click', event => {