mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
fix(core): fix circular import and simplify media types (#569)
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import type { MediaApiProxy } from '@videojs/core/dom';
|
||||
interface Attachable {
|
||||
attach(target: EventTarget): void;
|
||||
detach(): void;
|
||||
}
|
||||
|
||||
export function attachMediaElement<T extends HTMLVideoElement>(media: MediaApiProxy): (element: T | null) => void {
|
||||
export function attachMediaElement<T extends HTMLVideoElement>(media: Attachable): (element: T | null) => void {
|
||||
return (element: T | null) => {
|
||||
if (element) {
|
||||
media.attach(element);
|
||||
|
||||
Reference in New Issue
Block a user