feat(core): add vimeo media host and html/react components (#1667)

This commit is contained in:
Wesley Luyten
2026-06-18 09:36:31 +10:00
committed by GitHub
parent 035b509c7a
commit 1b31f3e8d7
25 changed files with 1551 additions and 77 deletions
@@ -0,0 +1,16 @@
'use client';
import type { MediaEngineHost } from '@videojs/core';
import type { RefCallback } from 'react';
import { useCallback } from 'react';
export function useAttachIframe<T extends HTMLIFrameElement>(media: MediaEngineHost): RefCallback<T> {
return useCallback(
(element: T | null) => {
if (element) media.attach?.(element);
else media.detach?.();
return () => media.detach?.();
},
[media]
);
}