@aidenlx/player
Version:
Headless web components that make integrating media on the a web a breeze.
119 lines • 5.83 kB
TypeScript
import { DisposalBin, LogController, LogDispatcher, RequestQueue } from '@vidstack/foundation';
import type { ReactiveElement } from 'lit';
import { VdsMediaEvent } from '../events';
import { MediaProviderElement } from '../provider/MediaProviderElement';
import { PendingMediaRequests } from '../request.events';
import { ReadableMediaStoreRecord, WritableMediaStoreRecord } from '../store';
import { MediaIdleController } from './MediaIdleController';
export declare type MediaControllerHost = ReactiveElement & {
exitFullscreen?(): Promise<void>;
};
/**
* The media controller acts as a message bus between the media provider and all other
* components, such as UI components and plugins. The main responsibilities are:
*
* - Provide the media store context that is used to pass media state down to components.
*
* - Listen for media request events and fulfill them by calling the appropriate props/methods on
* the current media provider.
*
* - Listen for media events and update the media store.
*/
export declare class MediaController {
protected readonly _host: MediaControllerHost;
protected readonly _disconnectDisposal: DisposalBin;
protected readonly _mediaProviderConnectedQueue: RequestQueue;
protected readonly _mediaProviderDisconnectedDisposal: DisposalBin;
constructor(_host: MediaControllerHost);
protected readonly _logController: LogController | undefined;
protected readonly _logger: LogDispatcher | undefined;
get logLevel(): import("@vidstack/foundation").LogLevel;
set logLevel(level: import("@vidstack/foundation").LogLevel);
protected _mediaProvider: MediaProviderElement | undefined;
get mediaProvider(): MediaProviderElement | undefined;
protected _handleMediaProviderConnect: void;
protected _handleMediaProviderDisconnect(): void;
protected _flushMediaProviderConnectedQueue(): void;
protected _setProviderAttr(name: string, value: string | boolean | null): void;
private readonly _mediaStoreProvider;
get store(): ReadableMediaStoreRecord;
/** @internal */
get _store(): WritableMediaStoreRecord;
protected _mediaIdleController: MediaIdleController;
get idleDelay(): number;
set idleDelay(delay: number);
protected _handleIdleChange: void;
/**
* Media requests that have been made but are waiting to be satisfied. Key represents the media
* event type the request is waiting for to be considered "satisfied".
*/
protected _pendingMediaRequests: PendingMediaRequests;
protected _clearPendingMediaRequests(): void;
protected _satisfyMediaRequest<T extends keyof PendingMediaRequests>(type: T, event: VdsMediaEvent<unknown>): void;
/**
* Override this to allow media events to bubble up the DOM.
*
* @param event
*/
protected _mediaRequestEventGateway(event: Event): boolean;
protected _createMediaRequestHandler<E extends Event>(queueKey: string, callback: (event: E) => void | Promise<void>): (event: E) => Promise<void>;
protected _handleCanLoad: void;
protected _handleMuteRequest: void;
protected readonly _handleUnmuteRequest: void;
protected readonly _handlePlayRequest: void;
protected readonly _handlePauseRequest: void;
protected _isSeekingRequestPending: boolean;
protected readonly _handleSeekingRequest: void;
protected readonly _handleSeekRequest: void;
protected readonly _handleVolumeChangeRequest: void;
protected readonly _handleEnterFullscreenRequest: void;
protected readonly _handleExitFullscreenRequest: void;
protected readonly _handleResumeIdlingRequest: void;
protected readonly _handlePauseIdlingRequest: void;
protected readonly _handleShowPosterRequest: void;
protected readonly _handleHidePosterRequest: void;
protected readonly _handleLoopRequest: void;
protected readonly _handleFullscreenChange: void;
protected readonly _handleFullscreenError: void;
protected _isReplay: boolean;
protected _isLooping: boolean;
protected _firingWaiting: boolean;
protected _originalWaitingEvent?: Event;
protected _mediaEvents: Event[];
protected _clearMediaStateTracking(): void;
protected _findLastMediaEvent(eventType: keyof GlobalEventHandlersEventMap): Event;
protected readonly _handleLoadStart: void;
protected readonly _handleLoadedData: void;
protected readonly _handleLoadedMetadata: void;
protected readonly _handleCanPlay: void;
protected readonly _handleCanPlayThrough: void;
protected readonly _handleAutoplay: void;
protected readonly _handleAutoplayFail: void;
protected readonly _handlePlay: void;
protected readonly _handlePlayFail: void;
protected readonly _handlePlaying: void;
protected readonly _handlePause: void;
protected readonly _handleTimeUpdate: void;
protected readonly _handleVolumeChange: void;
protected readonly _handleSeeking: void;
protected readonly _handleSeeked: void;
protected _stopWaiting(): void;
protected readonly _fireWaiting: (() => void) & {
cancel: () => void;
flush: () => void;
};
protected readonly _handleWaiting: void;
protected readonly _handleEnded: void;
protected readonly _handleAutoplayChange: void;
protected readonly _handleError: void;
protected readonly _handleFullscreenSupportChange: void;
protected readonly _handlePosterChange: void;
protected readonly _handleLoopChange: void;
protected readonly _handlePlaysinlineChange: void;
protected readonly _handleControlsChange: void;
protected readonly _handleMediaTypeChange: void;
protected readonly _handleDurationChange: void;
protected readonly _handleProgress: void;
protected readonly _handleSrcChange: void;
}
//# sourceMappingURL=MediaController.d.ts.map