@ebay/ebayui-core
Version:
Collection of core eBay components; considered to be the building blocks for all composite structures, pages & apps.
83 lines (82 loc) • 2.36 kB
TypeScript
import type { AttrString } from "marko/tags-html";
import type { WithNormalizedProps } from "../../global";
declare global {
interface Window {
shaka: any;
}
}
export interface PlayPauseEvent {
originalEvent: Event;
player: any;
}
export interface VolumeEvent {
originalEvent: Event;
volume: number;
muted: boolean;
}
interface VideoInput extends Omit<Marko.HTML.Video, `on${string}`> {
"play-view"?: "fullscreen" | "inline";
volume?: number;
action?: "play" | "pause";
"volume-slider"?: boolean;
clip?: any[];
source: Marko.AttrTag<Marko.HTML.Source>;
/**
* @deprecated Use `a11y-report-text` instead
*/
"report-text"?: AttrString;
"a11y-report-text"?: AttrString;
"a11y-mute-text"?: AttrString;
"a11y-unmute-text"?: AttrString;
"a11y-fullscreen-text"?: AttrString;
"a11y-exit-fullscreen-text"?: AttrString;
"spinner-timeout"?: number;
thumbnail?: string;
track?: Marko.AttrTag<Marko.HTML.Track>;
"error-text"?: AttrString;
"a11y-play-text"?: AttrString;
"a11y-load-text"?: AttrString;
"on-play"?: (event: PlayPauseEvent) => void;
"on-pause"?: (event: PlayPauseEvent) => void;
"on-volume-change"?: (event: VolumeEvent) => void;
"on-load-error"?: (err: Error) => void;
"shaka-config"?: any;
}
export interface Input extends WithNormalizedProps<VideoInput> {
}
interface State {
played: boolean;
failed: boolean;
isLoaded: boolean;
volumeSlider: boolean;
action: "play" | "pause" | "";
}
declare class Video extends Marko.Component<Input, State> {
video: HTMLVideoElement;
root: HTMLElement;
containerEl: HTMLElement;
player: any;
ui: any;
shaka: any;
isPlaylist(source: Marko.HTML.Source & {
src: string;
}): boolean;
handleResize(): void;
alignSeekbar(): void;
handlePause(originalEvent: Event): void;
handlePlaying(originalEvent: Event): void;
handleVolumeChange(originalEvent: Event): void;
handleError(err: Error): void;
showControls(): void;
takeAction(): void;
onInput(input: Input): void;
onCreate(): void;
_addTextTracks(): void;
_loadSrc(index?: number): void;
_attach(): void;
handleSuccess(): void;
onMount(): void;
onDestroy(): void;
_loadVideo(): void;
}
export default Video;