playable
Version:
Video player based on HTML5Video
52 lines (51 loc) • 1.42 kB
TypeScript
import View from './title.view';
import { IThemeService } from '../core/theme';
import { ITitleAPI, ITitle } from './types';
import { IPlayerConfig } from '../../../core/config';
declare class Title implements ITitle {
static moduleName: string;
static View: typeof View;
static dependencies: string[];
private _callback;
private _theme;
view: View;
isHidden: boolean;
constructor({ theme, config, }: {
theme: IThemeService;
config: IPlayerConfig;
});
getElement(): HTMLElement;
private _bindCallbacks;
private _initUI;
/**
* Display title text over the video. If you want to have clickable title, use `setTitleClickCallback`
*
* @param title - Text for the video title
*
* @example
* player.setTitle('Your awesome video title here');
*
* @note
* [Live Demo](https://jsfiddle.net/bodia/243k6m0u/)
*/
setTitle(title?: string): void;
/**
* Method for attaching callback for click on title
*
* @param callback - Your function
*
* @example
* const callback = () => {
* console.log('Click on title);
* }
* player.setTitleClickCallback(callback);
*
*/
setTitleClickCallback(callback?: () => void): void;
private _triggerCallback;
hide(): void;
show(): void;
destroy(): void;
}
export { ITitleAPI };
export default Title;