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 => {
className: 'title'
})
+ const playlistChannel = options.playlist.videoChannel
const leftSubtitle = super.createEl('div', {
- innerHTML: this.player().localize('By {1}', [ options.playlist.videoChannel.displayName ]),
+ innerHTML: playlistChannel
+ ? this.player().localize('By {1}', [ playlistChannel.displayName ])
+ : '',
className: 'channel'
})