feat(html): setup player api (#374)

This commit is contained in:
rahim
2026-02-02 21:11:44 +11:00
committed by GitHub
parent a1d0383d41
commit a419f5ef19
40 changed files with 678 additions and 1078 deletions
+16
View File
@@ -0,0 +1,16 @@
import { type Context, createContext } from '@lit/context';
import type { AnyPlayerStore, Media, PlayerStore } from '@videojs/core/dom';
export const PLAYER_CONTEXT_KEY = Symbol('@videojs/player');
export interface PlayerContextValue<Store extends PlayerStore = AnyPlayerStore> {
store: Store;
media: Media | null;
}
export type PlayerContext<Store extends PlayerStore = AnyPlayerStore> = Context<
typeof PLAYER_CONTEXT_KEY,
PlayerContextValue<Store>
>;
export const playerContext = createContext<PlayerContextValue, typeof PLAYER_CONTEXT_KEY>(PLAYER_CONTEXT_KEY);