rx-player
Version:
Canal+ HTML5 Video Player
39 lines • 2.09 kB
TypeScript
import type { IMainThreadMessage } from "../../main_thread/types";
import SharedReference from "../../utils/reference";
import type { ICoreMessage, IResolutionInfo } from "../types";
import type { ICorePlugins } from "./utils";
export type IMessageReceiverCallback = (evt: {
data: IMainThreadMessage;
}) => void;
/**
* Initialize a `CoreEntry`, which is the part of the RxPlayer acting as an
* entry point to all its "core" code.
*
* Its role is to receive and react to messages coming from "main thead", which
* may include loading and playing a content, and to send back messages for the main
* thread.
* @param {Function} setMessageReceiver - Declares the function that will
* receive messages coming from the "main thread" part of the RxPlayer logic.
* @param {Function} sendMessage - Function allowing to send messages to the
* "main thread" part of the RxPlayer logic.
* @param {Object} corePlugins - Callbacks that may have been registered by
* the application if it loaded the core independantly as a worker.
*/
export default function initializeCoreEntry(setMessageReceiver: (cb: IMessageReceiverCallback) => void, sendMessage: (msg: ICoreMessage, transferables?: Transferable[]) => void, corePlugins: ICorePlugins): void;
/**
* Collection of so-called "references": values configuring playback that may
* be updated at any time and that the CoreEntry should react on.
*/
export interface ICoreReferences {
limitVideoResolution: SharedReference<IResolutionInfo>;
/** Max buffer size after the current position, in seconds (we GC further up). */
maxBufferAhead: SharedReference<number>;
/** Max buffer size before the current position, in seconds (we GC further down). */
maxBufferBehind: SharedReference<number>;
/** Buffer maximum size in kiloBytes at which we stop downloading */
maxVideoBufferSize: SharedReference<number>;
throttleVideoBitrate: SharedReference<number>;
/** Buffer "goal" at which we stop downloading new segments. */
wantedBufferAhead: SharedReference<number>;
}
//# sourceMappingURL=core_entry.d.ts.map