aboutsummaryrefslogblamecommitdiffhomepage
path: root/client/src/assets/player/shared/bezels/bezels-plugin.ts
blob: cf07dbd2c950cc619b3883cf209d5b02224e7da8 (plain) (tree)
1
2
3
4
5
6
7
8
9
                              
                                          
 
                                          
 
                                   
 
                                                                            
                 




                                   



                                                           



                                              
 
                       
import videojs from 'video.js'
import { PauseBezel } from './pause-bezel'

const Plugin = videojs.getPlugin('plugin')

class BezelsPlugin extends Plugin {

  constructor (player: videojs.Player, options?: videojs.ComponentOptions) {
    super(player)

    this.player.ready(() => {
      player.addClass('vjs-bezels')
    })

    const component = new PauseBezel(player, options)
    player.addChild(component)

    this.on('dispose', () => player.removeChild(component))
  }
}

videojs.registerPlugin('bezels', BezelsPlugin)

export { BezelsPlugin }