西瓜播放器 HTML5 video video.js 播放器 HTML5播放器 mp4 hls hls.js flv flv.js dash dash.js 无缝切换

pc

Player PC interaction plugin。SourceCode

pluginName: pc

Function description:

    1. Move the mouse in the player area to move the call-out control bar
    1. Move the mouse out of the player area to hide/delay to hide the control bar
    1. Click the player area to switch pause/play
    1. Double click the player area to switch full screen/exit full screen
    1. Disable the right mouse button behavior in the player area

Note

The plug-in is only registered on the pc side

Hooks

videoClick

Click in the video area of the player, the default behavior is to pause/play switching, and it execute before triggering the default behavior, the usage is as follows

// Called by player instance
player.usePluginHooks('pc', 'videoClick', (plugin, ...args) =>{
  // TODO
})

// Called by plugin instance
player.getPlugin('pc').useHooks('videoClick', (plugin, ...args) =>{
  // TODO
  /**
   * If false is returned, the default logic is not executed
   * If it returns true, toggle pause/play
   * */
})

videoDbClick

Double-click in the video area of the player, the default behavior is to switch to full screen/exit full screen, and it execute before triggering the default behavior, the usage is as follows

// Called by player instance
player.usePluginHooks('pc', 'videoDbClick', (plugin, ...args) =>{
  // TODO
})

// Called by plugin instance
player.getPlugin('pc').useHooks('videoDbClick', (plugin, ...args) =>{
  // TODO
  /**
   * If false is returned, the default logic is not executed
   * If return true, enter/exit fullscreen
   * */
})