fix(core): fix circular import and simplify media types (#569)

This commit is contained in:
Sam Potts
2026-02-19 16:39:16 +11:00
committed by GitHub
parent 846d38e79b
commit 38b3a8f55c
4 changed files with 8 additions and 5 deletions
@@ -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);