@uploadcare/uc-video
Version:
Uploadcare's UCVideo solution for adaptive bitrate streaming
244 lines (243 loc) • 6.63 kB
TypeScript
import { default as Player } from 'video.js/dist/types/player';
export type VideoAttributes = {
autoplay: boolean | 'muted' | 'play' | 'any';
controls: boolean;
height: number | string;
width: number | string;
loop: boolean;
muted: boolean;
poster: string | null;
preload: 'none' | 'metadata' | 'auto';
controlslist: 'nodownload' | 'nofullscreen' | 'noremoteplayback';
crossorigin: 'anonymous' | 'use-credentials' | null;
disablepictureinpicture: boolean;
disableremoteplayback: boolean;
playsinline: boolean;
};
export type UploadcareVideoOptions = {
uuid: string | null;
cdnCname: string | null;
showLogo: boolean;
posterOffset: string;
};
export type VideojsOptions = {
aspectRatio?: string | null;
audioOnlyMode: boolean;
audioPosterMode: boolean;
autoSetup: boolean;
breakpoints: Record<'tiny' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'huge', number> | null;
children?: unknown[] | object | null;
disablePictureInPicture: boolean;
enableDocumentPictureInPicture: boolean;
enableSmoothSeeking: boolean;
experimentalSvgIcons: boolean;
fluid: boolean;
fill: boolean;
fullscreen: {
options: {
navigationUI: string;
};
};
id: string;
inactivityTimeout: number;
language: string;
languages: unknown;
liveui: boolean;
nativeControlsForTouch: boolean;
normalizeAutoplay: boolean;
notSupportedMessage: string;
noUITitleAttributes: boolean;
playbackRates: number[];
plugins: unknown;
posterImage: boolean;
preferFullWindow: boolean;
responsive: boolean;
restoreEl: boolean | Element;
skipButtons: unknown;
sources: {
src: string;
type: string;
}[] | null;
suppressNotSupportedError: boolean;
techCanOverridePoster: boolean;
techOrder: string[];
userActions: unknown;
spatialNavigation: {
enabled: boolean;
horizontalSeek: boolean;
};
html5: unknown;
};
export declare const DEFAULT_CDN_CNAME = "https://ucarecdn.com";
export declare const DEFAULT_HLS_OPTIONS: {
html5: {
handlePartialData: boolean;
nativeVideoTracks: boolean;
nativeAudioTracks: boolean;
nativeTextTracks: boolean;
vhs: {
overrideNative: boolean;
};
};
};
export declare const defaultVideoAttributes: {
autoplay: false;
controls: true;
height: string;
width: string;
loop: false;
muted: false;
poster: null;
preload: "auto";
controlslist: "nodownload";
crossorigin: null;
disablepictureinpicture: false;
disableremoteplayback: false;
playsinline: false;
};
export declare const uploadcareConfiguration: {
uuid: string;
cdnCname: string;
showLogo: true;
posterOffset: string;
};
export declare const videojsOptions: {
audioOnlyMode: false;
audioPosterMode: false;
autoSetup: false;
breakpoints: null;
disablePictureInPicture: false;
enableDocumentPictureInPicture: false;
enableSmoothSeeking: false;
experimentalSvgIcons: false;
fluid: false;
fill: false;
id: string;
inactivityTimeout: number;
language: string;
liveui: false;
nativeControlsForTouch: false;
normalizeAutoplay: false;
notSupportedMessage: string;
noUITitleAttributes: false;
playbackRates: never[];
posterImage: true;
preferFullWindow: false;
responsive: false;
restoreEl: false;
suppressNotSupportedError: false;
techCanOverridePoster: false;
techOrder: string[];
sources: null;
fullscreen: {
options: {
navigationUI: string;
};
};
languages: undefined;
plugins: undefined;
skipButtons: undefined;
userActions: undefined;
spatialNavigation: {
enabled: false;
horizontalSeek: false;
};
html5: {
handlePartialData: boolean;
nativeVideoTracks: boolean;
nativeAudioTracks: boolean;
nativeTextTracks: boolean;
vhs: {
overrideNative: boolean;
};
};
};
export declare const initialConfiguration: Readonly<{
audioOnlyMode: false;
audioPosterMode: false;
autoSetup: false;
breakpoints: null;
disablePictureInPicture: false;
enableDocumentPictureInPicture: false;
enableSmoothSeeking: false;
experimentalSvgIcons: false;
fluid: false;
fill: false;
id: string;
inactivityTimeout: number;
language: string;
liveui: false;
nativeControlsForTouch: false;
normalizeAutoplay: false;
notSupportedMessage: string;
noUITitleAttributes: false;
playbackRates: never[];
posterImage: true;
preferFullWindow: false;
responsive: false;
restoreEl: false;
suppressNotSupportedError: false;
techCanOverridePoster: false;
techOrder: string[];
sources: null;
fullscreen: {
options: {
navigationUI: string;
};
};
languages: undefined;
plugins: undefined;
skipButtons: undefined;
userActions: undefined;
spatialNavigation: {
enabled: false;
horizontalSeek: false;
};
html5: {
handlePartialData: boolean;
nativeVideoTracks: boolean;
nativeAudioTracks: boolean;
nativeTextTracks: boolean;
vhs: {
overrideNative: boolean;
};
};
autoplay: false;
controls: true;
height: string;
width: string;
loop: false;
muted: false;
poster: null;
preload: "auto";
controlslist: "nodownload";
crossorigin: null;
disablepictureinpicture: false;
disableremoteplayback: false;
playsinline: false;
uuid: string;
cdnCname: string;
showLogo: true;
posterOffset: string;
}>;
export declare const allKeysConfiguration: string[];
export declare const complexConfigKeys: string[];
export declare const plainConfigKeys: string[];
export declare const toKebabCase: (str: string) => string | undefined;
export declare const attrKeyMapping: any;
export declare const arrayAttrKeys: Set<unknown>;
export type VideoPlayerWithPlugins = Player & {
LogoInstance: (options: {
active: boolean;
}) => void;
generatePoster: (options: {
videoEl: HTMLVideoElement | null;
posterOffset: UploadcareVideoOptions['posterOffset'];
crossOrigin: VideoAttributes['crossorigin'];
}) => void;
httpSourceSelector: () => void;
UUIDSourceInstance: (options: {
uuid: string;
cdnCname: string;
}) => void;
};