mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
feat(html): setup player api (#374)
This commit is contained in:
@@ -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);
|
||||
Reference in New Issue
Block a user