import { ContainerNode } from 'preact'; import { Gradient } from './gradient.ts'; import { PlaylistMethods } from '../embeds/shared/playlists/playlist-methods.ts'; import { CarouselData, CarouselHardWallData } from './carousel.ts'; import { ControlInstances } from './controls.ts'; import type { BasePluginInstance, PluginConfigs, PluginInstances } from './plugins.ts'; import { SentryScope } from './sentry.ts'; import { EventShepherd } from '../utilities/eventShepherd.ts'; import type { EmbedOptions } from './EmbedOptions.ts'; import { Poster, PosterEmbedOptions } from './poster.ts'; import { LiveStreamEventData } from './live-stream-event.ts'; export type AllowedQualities = 224 | 360 | 540 | 720 | 1080 | 2160; export interface HlsAudioTrack { assocLang?: string; audioCodec?: string; autoselect?: boolean; channels?: string; characteristics?: string; default?: boolean; forced?: boolean; groupId?: string; id: number; instreamId?: string; label?: string; lang?: string; language?: string; name?: string; type?: 'AUDIO'; } export type heightOrWidthOptions = { constrain?: boolean; fullscreen?: boolean; trigger?: boolean; }; export type AnnotationOverlayOptions = { duration?: number; position?: 'left' | 'right'; text: string; theme?: 'dark' | 'light'; time?: number; transition?: 'fade' | 'pop'; transitionTime?: number; type: 'annotation'; url?: string; }; export interface Detect { hdr: boolean; video: { webm: boolean; }; } export type EventListenerEntry = { listener: EventListenerOrEventListenerObject; options?: AddEventListenerOptions | boolean; }; export type EventListenerMap = Record; export type ModalOverlayOptions = { mount: (rootElem?: ContainerNode) => Promise | void; transition?: 'fade' | 'slide'; transitionDirection?: 'ltor'; transitionTime?: number; type: 'modal'; }; export type OverlayOptions = AnnotationOverlayOptions | ModalOverlayOptions; export type PlayerLanguage = { code: string; text: string; }; export interface ControlBarDialog { close: () => Promise; hasOpened: () => boolean; isOpen: () => boolean; open: () => Promise; resize: () => void; } export type MediaDataServerResponse = { error?: boolean | string; iframe?: boolean | string; media?: MediaData; message?: string; options?: EmbedOptions; }; export type MediaDataServerErrorResponse = Pick; export interface Media { hashedId: string; options: { channel: string; channelPreferences: { lastVideoPlayed: string; playbackRate: number; }; hideAudioContextMenu: boolean; playerColor: string; plugin: { watchNext: { on: boolean; playerColor: string; }; }; podcastingIsEnabled: boolean; resumable: boolean; seo: boolean; shouldShowDescription: boolean; silentAutoPlay: boolean; transition: string; transitionTime: string; turnstileStorageKey: [string]; videoContainerId: string; wmod: string; }; } export type TimeMapping = [number, number]; export interface LegacyLanguage { alpha3Bibliographic: string; alpha3Terminologic: string; genericName: string; genericNativeName: string; ietfLanguageTag: string; isLocalization: boolean; iso6392LanguageCode: string; name: string; nativeName: string; sourceLanguage?: boolean; } export interface Language extends LegacyLanguage { bcp47LanguageTag: string; familyName: string; familyNativeName: string; isOriginal?: boolean; name: string; nativeName: string; wistiaLanguageCode: string; } export interface LanguageSimplified { bcp47LanguageTag: string; familyName: string; familyNativeName: string; hasCaptions?: boolean; hasVideoStream?: boolean; isOriginal?: boolean; localizationIntent?: 'alternate_audio' | 'dubbed_media'; name: string; nativeName: string; sourceLanguage?: boolean; wistiaLanguageCode: string; } export interface Localization extends Language { duration: number; hashedId: string; isLocalization: true; localizationIntent?: 'alternate_audio' | 'dubbed_media'; timeMappings?: TimeMapping[]; } export interface MediaAsset { bitrate: number; codec?: string; container?: string; created_at?: number; details?: Record; display_name: string; ext?: string; height: number; metadata?: { [x: string]: unknown; av_stream_metadata?: string; average_bitrate?: number; early_max_bitrate?: number; frame_count?: number; frame_height?: number; frame_width?: number; max_bitrate?: number; served_by_media_api?: number; }; opt_vbitrate?: number; progress?: number; public: boolean; segment_duration?: number; size: number; slug: string; status: number; type: 'alternate_audio' | 'enhanced_audio_video' | 'enhanced_audio' | 'extended_audio_description_mp3' | 'hd_mp4_video' | 'hdr_video' | 'hls' | 'image' | 'iphone_video' | 'md_mp4_video' | 'mp3_audio' | 'mp4_alternate_audio_file' | 'mp4_h264_196k' | 'mp4_h264_1127k' | 'mp4_video' | 'original' | 'rss_imported_still_image' | 'still_image' | 'storyboard' | 'video'; url?: string; width: number; } export interface MediaData { accountId?: number; accountKey?: string; analyticsHost?: string; aspectRatio?: number | null; assets?: MediaAsset[]; branding?: boolean; carouselHardWall?: boolean; channelArtUrl?: string | null; channelHashedId?: string; channelPodcastLinks?: string; channelTitle?: string; createdAt?: number; distilleryUrl?: string; duration?: number; embedOptions?: EmbedOptions; enableCustomerLogo?: boolean; error?: never; firstEmbedForAccount?: boolean; firstShareForAccount?: boolean; hashedId?: string; ietfLanguageTag?: string; iframe?: never; integrations?: Record; liveStreamEventDetails?: { hashedId: string; id: number; m3u8RenditionProgramTime?: Date; manifestUrl?: string; scheduledFor?: Date; startedAt?: Date; }; localizations?: Localization[]; mediaId?: number; mediaKey?: string; mediaType?: 'ab-test' | 'Audio' | 'LiveStream' | 'Video'; name?: string; originalFileStillAsset?: string; originalIsEligibleForDirectPlayback?: boolean; preloadPreference?: string | null; progress?: number; projectId?: number | null; protected?: boolean; seoDescription?: string; showAbout?: boolean; sourceHashedId?: string; sourceMediaId?: number; sourceMediaKey?: string; stats?: Record; status?: number; trackingTransmitInterval?: number; type?: 'ab-test' | 'Audio' | 'LiveStream' | 'Video'; } export interface WistiaContainerHTMLElement extends HTMLElement { api?: PublicApi | 'removed' | null | undefined; deprecatedApiDoNotUse?: PublicApi | 'removed' | null | undefined; wistiaApi?: PublicApi | 'removed' | null | undefined; } export interface Attributes { aspect?: number; aspectRatio?: number | null; autoplay?: boolean; bigPlayButton: boolean; bigPlayButtonBorderRadius: number; contrastIcons?: boolean; controlBarBorderRadius: number; controlsVisibleOnLoad: boolean; copyLinkAndThumbnail: boolean; currentTime?: number; doNotTrack?: boolean; email?: string; endVideoBehavior: 'default' | 'loop' | 'reset'; fitStrategy?: 'contain' | 'cover' | 'fill'; floatingControlBar: boolean; fullscreenControl: boolean; muted?: boolean; opaqueControls?: boolean; playbackRate?: number; playbackRateControl: boolean; playBarControl: boolean; playerBorderRadius: number; playerColor: string; playerColorGradient?: Gradient; playlistLinks?: string; playlistLoop?: boolean; playPauseControl: boolean; playPauseNotifier?: boolean; playSuspendedOffScreen?: boolean | 'auto'; popoverContent?: boolean; poster?: string; preload?: 'auto' | 'metadata' | 'none'; qualityControl: boolean; qualityMax: AllowedQualities; qualityMin: AllowedQualities; resumable?: boolean | 'auto'; rotateToFullscreen?: boolean; roundedPlayer: number; seo?: boolean; settingsControl: boolean; silentAutoplay?: boolean | 'allow'; statsUrl?: string; transparentLetterbox?: boolean; videoQuality?: number | 'auto'; volume?: number; volumeControl: boolean; } export type CustomerLogoPlacementOption = 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right'; export declare const PlayerTransitionOptions: { crossfade: string; fade: string; slide: string; slideleft: string; slideright: string; }; export type PlayerTransitionType = keyof typeof PlayerTransitionOptions; export interface ReplaceWithMediaOptions extends EmbedOptions { transition?: PlayerTransitionType; } export interface VideoTracker { log: (action: string, type: string, data: object) => void; } export interface CarouselHardWallPlayerImpl { handleSubmitPassword: (password: string) => void; updateHardWallData: (data: CarouselHardWallData) => void; } export interface Impl extends Partial { _attrs: Attributes; _mediaData: MediaData | undefined; _oldEngine: object | null | undefined; _opts: EmbedOptions | undefined; _tracker: VideoTracker | null | undefined; addLoopBehavior: () => void; aspect: () => number; audioDescriptionControlEnabled: (shouldDisplay?: boolean) => Impl; bigPlayButtonEnabled: (shouldDisplay?: boolean) => Impl; cancelFullscreen: () => Promise; cancelOverlay: (name: string) => void; captionsLanguage: PublicApi['captionsLanguage']; captionsLanguageCode: PublicApi['captionsLanguageCode']; changeAudioTrack: (trackId: number) => void; container: HTMLElement; contrastIcons: (isEnabled: boolean) => void; controls: ControlInstances; defineOverlay: (name: string, overlay: object) => void; duration: () => number; embed: (oldImpl?: Impl) => void; embedElement: HTMLElement; embedType: Players; engine: object | null | undefined; enterInputContext: (context: string) => void; eventKey: () => string | undefined; exitInputContext: (context: string) => void; fullscreenControlEnabled: (shouldDisplay?: boolean) => Impl; getAudioTracks: () => Promise; getControl: (name: string) => object | undefined; getCurrentAudioTrack: () => Promise; getInputContext: () => string | undefined; getReadyState: () => number | undefined; getStandardBuffered: () => TimeRanges | undefined; getVideoQuality: () => number | 'auto'; height: (val?: number, options?: heightOrWidthOptions) => number | undefined; inFullscreen: () => boolean; isControlEnabled: (handle: string) => boolean; isInstantHls: () => boolean; isMuted: () => boolean; language: PublicApi['language']; languages: PublicApi['languages']; languagesToLocalizations: PublicApi['languagesToLocalizations']; mediaLanguage: PublicApi['mediaLanguage']; mediaLanguageCode: PublicApi['mediaLanguageCode']; mediaLanguages: PublicApi['mediaLanguages']; mute: () => Promise; on: (eventName: string, callback: () => void) => () => void; opaqueControls: (areControlsOpaque: boolean) => void; pause: () => Promise; percentWatched: () => number; play: () => Promise; playbackRate: (rate?: number) => number; playbackRateControlEnabled: (shouldDisplay?: boolean) => boolean | undefined; playbarControlEnabled: (shouldDisplay?: boolean) => Impl; playerColor: (newColor?: string) => Impl | string; playerColorGradient: (gradient: Gradient) => Impl; playPauseControlEnabled: (shouldDisplay?: boolean) => Impl; playPauseNotifierEnabled: (shouldDisplay?: boolean) => Impl; plugin: PluginInstances; preloadValue: () => EmbedOptions['preload'] | undefined; publicApi: PublicApi; qualityControlEnabled: (shouldDisplay?: boolean) => boolean | undefined; qualityMax: (quality: AllowedQualities) => void; qualityMin: (quality: AllowedQualities) => void; rebuild: (options?: object) => Impl; releaseControls: (name: string) => Promise; removeLoopBehavior: () => void; renderUI: () => void; requestControls: (name: string) => Promise; requestFullscreen: () => Promise; requestOverlay: (name: string) => void; rotateToFullscreen: (shouldRotate: boolean) => void; secondsWatched: () => number; secondsWatchedVector: () => number[]; setAriaLiveText: (text: string) => void; setBigPlayButtonBorderRadius: (radius?: number) => number | undefined; setControlBarBorderRadius: (radius?: number) => number | undefined; setControlEnabled: (handle: string, enabled: boolean) => void; setPlayerBorderRadius: (radius?: number) => number | undefined; setResumable: (val: boolean | string) => void; setRoundedPlayer: (radius?: number) => number | undefined; settingsControlEnabled: (shouldDisplay?: boolean) => Impl; setVideoQuality: (qual: number | 'auto') => void; sourceHashedId: () => string | undefined; state: () => PlayerState; time: (newTime?: number, options?: { lazy: boolean; }) => Promise | number; uiContainer: HTMLElement; undefineOverlay: (name: string) => void; unmute: () => Promise; videoHeight: (val?: number, options?: Omit) => number | undefined; videoWidth: (val?: number, options?: Omit) => number | undefined; volume: (vol?: number) => Impl; volumeControlEnabled: (shouldDisplay?: boolean) => Impl; width: (val?: number, options?: heightOrWidthOptions) => number | undefined; } export interface PublicApi { _attrs: Attributes; _bindings?: Record | null | undefined; _impl: Impl | undefined; _mediaData: MediaData | undefined; _opts: EmbedOptions | undefined; addPlugin: (name: T, options: PluginConfigs[T]) => Promise; addToPlaylist: (hashedId: string, options: object, position: object) => Record[]; aspect: () => number; bind: (eventName: string, param1: number | ((args: unknown) => void), param2?: number | (() => void), param3?: () => void) => () => void; cancelFullscreen: () => void; captionsEnabled: (enabled?: boolean) => boolean; captionsLanguage: (language?: string) => LanguageSimplified; captionsLanguageCode: (code?: string) => string; captionsLanguages: () => LanguageSimplified[]; chrome: HTMLElement | undefined; container: WistiaContainerHTMLElement | undefined; doNotTrack: () => boolean; duration: () => number; email: (newEmail?: string) => string | null; embedded: (callback?: () => void) => PublicApi | boolean; embedIndex: (index: number, options?: Record) => void; embedNext: () => void; embedOptions: () => EmbedOptions | undefined; embedPrevious: () => void; eventKey: () => string | undefined; foreignData: (data?: Record) => Record | null; foreignIds: () => { type: string; value: string; }[]; getRemapTime: () => Promise<(fromLanguage: string, toLanguage: string, time: number) => number>; hasData: (callback?: () => void) => PublicApi | boolean; hashedId: () => string | undefined; hasPlugin: (name: string) => boolean; heightForWidth: (width: number) => number; iframe: HTMLElement | undefined; inFullscreen: () => boolean; isControlEnabled: (handle: string) => boolean; isMuted: () => boolean; isRemoved: () => boolean; language: (language?: string) => LanguageSimplified | undefined; languages: () => LanguageSimplified[]; languagesToLocalizations: (languages: LanguageSimplified[]) => Localization[]; languageToLocalization: (language: LanguageSimplified) => Localization | undefined; mediaLanguage: (language?: string) => LanguageSimplified; mediaLanguageCode: (code?: string) => string; mediaLanguages: () => LanguageSimplified[]; mute: () => PublicApi; mux: Mux | undefined; name: () => string; nextVideo: () => Media | undefined; on: (eventName: string, callback: () => void) => () => void; opaqueControls: (areControlsOpaque: boolean) => void; pause: () => PublicApi; percentWatched: () => number; play: () => PublicApi; playbackRate: (newRate?: number) => number | undefined; playerColor: (newColor?: string) => string; playerLanguage: () => PlayerLanguage | undefined; playlistShouldAutoAdvance: () => boolean; plugin: PluginInstances; plugins: PluginInstances; popover: Popover | undefined; preload: (val?: string) => string; previousVideo: () => Media | undefined; rebuild: () => void; remove: (opts?: object) => void; removePlugin: (name: string) => void; replaceWith: (hashedId: string, options: ReplaceWithMediaOptions) => void; requestFullscreen: () => void; secondsWatched: () => number; secondsWatchedVector: () => number[]; setControlEnabled: (name: string, enabled: boolean) => void; setEmbedHost: (embedHost: string) => void; setPlaylist: (hashedIds: string[], options?: EmbedOptions) => void; sourceHashedId: () => string | undefined; state: () => PlayerState; stillUrl: () => string | null; trigger: (eventName: string, ...args: unknown[]) => PublicApi; unbind: (eventName: string, param1: number | ((...args: unknown[]) => void), param2?: number | ((...args: unknown[]) => void), param3?: () => void) => () => void; unmute: () => void; up: StopGoType; videoHeight: () => number; videoWidth: () => number; visitorKey: () => string; whenControlMounted: (controlName: T) => Promise; width: (newWidth?: number | null, options?: object) => number; widthForHeight: (height: number) => number; height(): number; height(newHeight: number, opts?: { constrain?: boolean; }): PublicApi; ready(callback?: () => void): PublicApi; ready(): boolean; time(): number; time(newTime: number, options?: { lazy: boolean; }): PublicApi; videoQuality(): number | string; videoQuality(qual: number | string): Impl; volume(): number; volume(newVolume: number): PublicApi; } export interface LoggerType { getPrefixedFunctions: (prefix: string) => object; info: (...args: string[]) => void; } export type StopGoType = { (x?: boolean | (() => void)): void; synchronize: (y: (z: () => void) => void) => void; new (): StopGoType; }; export interface PublicApiOptions { container: HTMLElement | string; mediaData?: MediaData | MediaDataServerErrorResponse; } export interface FreshUrl { originalUrl: string; } export interface Mux { destroy: () => void; init: (video: PublicApi, options?: { embedType?: string; }) => void; } export interface Popover { height: (newHeight?: number, options?: { constrain?: boolean; }) => number; hide: () => void; isVisible: () => boolean; show: () => void; showAndPlay: () => void; width: (newWidth?: number, options?: { constrain?: boolean; }) => number; } export interface DeprecatedEmbedListener extends Array { each: (callback: (api: PublicApi) => void) => void; on: (eventName: string, callback: () => void) => () => void; } export type PlayerState = 'beforeplay' | 'ended' | 'paused' | 'playing'; export type PlayerConstructor = new (publicApi: PublicApi) => T; export type Players = 'carouselHardWall' | 'external' | 'html5' | 'notplayable' | 'passwordprotected' | 'simplehtml5' | 'vulcan' | 'vulcan-v2'; export type PopoverAnimation = 'fade' | 'none' | 'slide'; export type PopoverContentSettings = 'html' | 'link' | 'poster' | 'thumbnail'; export type WistiaLocalStorage = Record | undefined>; export type PlayerLifecycleCallback = (player: PublicApi) => void; export interface JudyContext { detect: Detect; inIframe: boolean; location: object; logger: LoggerType; pageUrl: string; silenceGlobalWarnings?: boolean; userAgent: string; } export interface WQConfigEntry { id: string; onEmbedded?: PlayerLifecycleCallback; onFind?: PlayerLifecycleCallback; onHasData?: PlayerLifecycleCallback; onReady?: PlayerLifecycleCallback; options?: EmbedOptions; } export interface WQRevokeEntry { revoke: WQConfigEntry; } export type WQCallback = (W: WistiaGlobal) => void; export type WQEntry = WQCallback | WQConfigEntry | WQRevokeEntry; export interface WistiaGlobal { _destructors: Record void> | null; _initializers: { initVisitorKey?: () => void; } | null; _inlineMediaData?: Record; _isListeningForGlobalErrors?: boolean; _isListeningForGlobalUnhandledRejections?: boolean; _liveStreamEventDataPromises: Record>; _liveStreamPollingPromises: Record>; _mediaDataPromises: Record>>; _privacyModeSources?: Record; _remoteData: Map; _sentryScope: SentryScope; _tagManager?: { el: HTMLElement | null; refs: number; }; _viewerPreferencesEnabled?: boolean; api: (matcher?: number | string) => PublicApi | null; CarouselHardWallPlayer: PlayerConstructor; defineControl: (control: unknown) => void; embed: (hashedId: number | string, options: EmbedOptions | PublicApiOptions | undefined) => void; embedPoster?: (hashedId: number | string, options: PosterEmbedOptions) => Promise; EventShepherdManager: Record; ExternalPlayer: PlayerConstructor; flushInitQueue?: () => void; Html5Player: PlayerConstructor; isSentryInitialized?: boolean; Metrics: { videoCount: (video: Impl, key: string, val?: number, extraData?: Record) => void; }; mixin: ((klass: object, obj: object) => void) | null; NotPlayablePlayer: PlayerConstructor; PasswordProtectedPlayer: PlayerConstructor; Player: PlayerConstructor; playlistMethods?: Map; plugin: (name: string, definition: (video: PublicApi, options: Record) => unknown) => void; Plugin: { Base: new (video: PublicApi, options: Record) => BasePluginInstance>; }; PublicApi: ((hashedId: number | string, options: EmbedOptions | PublicApiOptions | undefined) => void) | null; uncacheCaptions?: (hashedId: string) => void; uncacheMedia: (hashedId: string) => void; Video: PlayerConstructor; VisitorKey: { generate: () => string; } | null; visitorKey: { value: () => string; } | null; VulcanPlayer: PlayerConstructor; VulcanV2Player: PlayerConstructor; wistia: number | undefined; } export type WindowWistia = WistiaGlobal | null | undefined; export type WindowWQ = WQEntry[] | undefined; export declare const isPublicApi: (input: unknown) => input is PublicApi; //# sourceMappingURL=player-api-types.d.ts.map