interface PlayerOptions {
container?: HTMLElement | string;
video?: HTMLVideoElement;
src?: string;
videoProps?: Record<string, any>;
videoSources?: VideoSource[];
live?: boolean;
autoSeekTime?: number;
thumbnail?: ThumbnailOptions;
controls?: (ControlItem | string)[][];
bpControls?: { [key: string]: (ControlItem | string)[][] }
settings?: (SettingItem | string)[];
contextMenus?: (ContextMenuItem | string)[];
contextMenuToggle?: boolean;
plugins?: Plugin[];
i18n?: string;
shortcut?: boolean;
seekStep?: number;
volumeStep?: number;
themeColor?: string;
posterBgColor?: string;
progressBg?: string;
progressDot?: HTMLElement;
volumeProgressBg?: string;
volumeBarLength?: number | string;
volumeVertical?: boolean;
loadingEl?: HTMLElement;
openEdgeInIE?: boolean;
poster?: string;
posterEnable?: boolean;
posterPlayEl?: HTMLElement;
isTouch?: boolean;
[key: string]: any;
}
interface VideoSource {
media?: string;
sizes?: string;
src?: string;
srcset?: string;
type?: string;
}
interface ThumbnailOptions {
startSecond?: number;
gapSecond?: number;
row?: number;
col?: number;
width?: number;
height?: number;
images?: string[];
}
interface ControlItem {
el: HTMLElement;
id?: any;
tip?: string;
tooltip?: Tooltip;
mounted?: boolean;
init?: (player: Player, position: number, tooltip: Tooltip) => void;
update?: (position: number) => void;
hide?: () => void;
isSupport?: (player: Player) => boolean;
dispose?: () => void;
[key: string]: any;
}
interface SettingItem<T = any> {
id?: string;
html?: string;
type?: 'switch' | 'select';
checked?: boolean;
options?: SettingItemOption<T>[];
value?: T;
init?: (player: Player, item: SettingItem) => void;
change?: (value: T, player: Player, item: SettingItem) => void;
_switch?: Switch;
_selectedEl?: HTMLElement;
_optionEls?: HTMLElement[];
_optionEl?: HTMLElement;
[key: string]: any;
}
interface ContextMenuItem {
id?: string;
html?: string;
disabled?: boolean;
invisible?: boolean;
checked?: boolean;
init?: (player: Player, item: ContextMenuItem) => void;
show?: (player: Player, item: ContextMenuItem) => void;
click?: (player: Player, item: ContextMenuItem) => void;
}
interface Plugin {
apply: (player: Player) => void;
dispose?: () => void;
}