4 changed files with 6 additions and 42 deletions
@ -1,21 +0,0 @@ |
|||||||
import { Controller } from "@/stores/player/controllers/types"; |
|
||||||
|
|
||||||
export function useBaseController(): Controller { |
|
||||||
let el: HTMLVideoElement | undefined; |
|
||||||
|
|
||||||
return { |
|
||||||
registerVideoElement(video) { |
|
||||||
el = video; |
|
||||||
}, |
|
||||||
pause() { |
|
||||||
el?.pause(); |
|
||||||
}, |
|
||||||
play() { |
|
||||||
el?.play(); |
|
||||||
}, |
|
||||||
setVolume(target) { |
|
||||||
if (!el) return; |
|
||||||
el.volume = target; |
|
||||||
}, |
|
||||||
}; |
|
||||||
} |
|
Loading…
Reference in new issue