pc
Player PC interaction plugin。SourceCode
pluginName: pc
Function description:
- Move the mouse in the player area to move the call-out control bar
- Move the mouse out of the player area to hide/delay to hide the control bar
- Click the player area to switch pause/play
- Double click the player area to switch full screen/exit full screen
- 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
* */
})