mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-30 20:21:20 -08:00
refactor(mask): [PKG-MASK-04] migrate strict types and preserve public consumers
This commit is contained in:
1 parent
aba125262a
commit
aca4bc1cd2
30 files changed
+1848
-72
No files matched your search
@@ -0,0 +1,21 @@
|
||||
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,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user