bitmovin-player-react
Version:
A React component that creates an instance of Bitmovin player
34 lines (33 loc) • 1.79 kB
TypeScript
import { PlayerAPI, PlayerConfig, SourceConfig } from 'bitmovin-player';
import { UIContainer, UIVariant } from 'bitmovin-player-ui';
import { MutableRefObject, RefCallback } from 'react';
export type UiContainerFactory = () => UIContainer;
export type UiVariantsFactory = () => UIVariant[];
export type CustomUi = {
containerFactory: UiContainerFactory;
} | {
variantsFactory: UiVariantsFactory;
};
export interface BitmovinPlayerProps {
config: PlayerConfig;
source?: SourceConfig;
className?: string;
playerRef?: MutableRefObject<PlayerAPI | null | undefined> | RefCallback<PlayerAPI>;
ref?: MutableRefObject<HTMLDivElement | null | undefined> | RefCallback<HTMLDivElement | null>;
/**
* - If the `config.ui` is `false` the UI is disabled.
*
* - If the `config.ui` is a truthy value the default `UIFactory.buildDefaultUI` is used from `bitmovin-player-ui`.
* The `config.ui` is passed to the internal `UIManager` that initializes UI as UI configuration.
* Also 'bitmovin-player-ui/dist/css/bitmovinplayer-ui.css' should be included in an entry point file or custom CSS should be implemented.
*
* - If the `config.ui` is a truthy value and a UI container factory `ui.containerFactory` or a UI variants factory `ui.variantsFactory` is provided,
* it is used instead of the `UIFactory.buildDefaultUI` from `bitmovin-player-ui`.
*
* References:
* - https://www.npmjs.com/package/bitmovin-player-ui.
* - https://cdn.bitmovin.com/player/web/8/docs/interfaces/Core.PlayerConfig.html#ui.
* */
customUi?: CustomUi;
}
export declare const BitmovinPlayer: import("react").ForwardRefExoticComponent<Omit<BitmovinPlayerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;