playable
Version:
Video player based on HTML5Video
159 lines (158 loc) • 4.58 kB
TypeScript
import View from './bottom-block.view';
import { IEventEmitter } from '../../event-emitter/types';
import { IPlayControl } from '../controls/play/types';
import { ITimeControl } from '../controls/time/types';
import { IProgressControl } from '../controls/progress/types';
import { IVolumeControl } from '../controls/volume/types';
import { IFullScreenControl } from '../controls/full-screen/types';
import { ILogoControl } from '../controls/logo/types';
import { IDownloadButton } from '../controls/download/types';
import { IChromecastButton } from '../controls/chromecast/types';
import { IPictureInPictureControl } from '../controls/picture-in-picture/types';
import { IBottomBlockAPI, IBottomBlock } from './types';
interface IDependencies {
eventEmitter: IEventEmitter;
playControl: IPlayControl;
progressControl: IProgressControl;
timeControl: ITimeControl;
volumeControl: IVolumeControl;
fullScreenControl: IFullScreenControl;
logo: ILogoControl;
downloadButton: IDownloadButton;
chromecastButton: IChromecastButton;
pictureInPictureControl: IPictureInPictureControl;
}
interface IAddControllOptions {
position?: 'left' | 'right';
}
declare class BottomBlock implements IBottomBlock {
static moduleName: string;
static View: typeof View;
static dependencies: string[];
private _eventEmitter;
private _isBlockFocused;
private _unbindEvents;
view: View;
isHidden: boolean;
constructor(dependencies: IDependencies);
private _getControlElements;
getElement(): HTMLElement;
addControl(key: string, element: HTMLElement, options?: IAddControllOptions): void;
private _initUI;
private _bindEvents;
private _bindViewCallbacks;
private _setFocusState;
private _removeFocusState;
get isFocused(): boolean;
showContent(): void;
hideContent(): void;
hide(): void;
show(): void;
/**
* Method for allowing logo to be always shown in bottom block
* @param flag - `true` for showing always
* @example
* player.setAlwaysShowLogo(true);
*
*/
setAlwaysShowLogo(flag: boolean): void;
/**
* Method for hiding logo. If you use `setAlwaysShowLogo` or `setControlsShouldAlwaysShow`, logo would automaticaly appear.
* @example
* player.hideLogo();
*/
hideLogo(): void;
/**
* Method for showing logo.
* @example
* player.showLogo();
*/
showLogo(): void;
/**
* Method for showing play control.
* @example
* player.showPlayControl();
*/
showPlayControl(): void;
/**
* Method for showing volume control.
* @example
* player.showVolumeControl();
*/
showVolumeControl(): void;
/**
* Method for showing time control.
* @example
* player.showTimeControl();
*/
showTimeControl(): void;
/**
* Method for showing full screen control.
* @example
* player.showFullScreenControl();
*/
showFullScreenControl(): void;
/**
* Method for showing picture-in-picture control.
* @example
* player.showPictureInPictureControl();
*/
showPictureInPictureControl(): void;
/**
* Method for showing progress control.
* @example
* player.showProgressControl();
*/
showProgressControl(): void;
/**
* Method for showing download button.
* @example
* player.showDownloadButton();
*/
showDownloadButton(): void;
/**
* Method for hiding play control.
* @example
* player.hidePlayControl();
*/
hidePlayControl(): void;
/**
* Method for hiding voluem control.
* @example
* player.hideVolumeControl();
*/
hideVolumeControl(): void;
/**
* Method for hiding time control.
* @example
* player.hideTimeControl();
*/
hideTimeControl(): void;
/**
* Method for hiding full screen control.
* @example
* player.hideFullScreenControl();
*/
hideFullScreenControl(): void;
/**
* Method for hiding picture-in-picture control.
* @example
* player.hidePictureInPictureControl();
*/
hidePictureInPictureControl(): void;
/**
* Method for hiding progress control.
* @example
* player.hideProgressControl();
*/
hideProgressControl(): void;
/**
* Method for hiding download button.
* @example
* player.hideDownloadButton();
*/
hideDownloadButton(): void;
destroy(): void;
}
export { IBottomBlockAPI };
export default BottomBlock;