mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-18 19:01:20 -08:00
22 lines
650 B
TypeScript
22 lines
650 B
TypeScript
import type { MaskHost, MaskOptions } from './types'
|
|
import maskConfig from './config'
|
|
import MaskController from './controller'
|
|
|
|
export default function artplayerPluginDanmukuMask(option: MaskOptions = {}) {
|
|
return (art: MaskHost) => {
|
|
const { template: { $video, $danmuku } } = art
|
|
const controller = new MaskController(art, maskConfig(option), { $video, $danmuku })
|
|
async function startSegmentation() {
|
|
await controller.start()
|
|
}
|
|
function stopSegmentation() {
|
|
controller.stop()
|
|
}
|
|
return {
|
|
name: 'artplayerPluginDanmukuMask',
|
|
start: startSegmentation,
|
|
stop: stopSegmentation,
|
|
}
|
|
}
|
|
}
|