lbry-desktop/ui/component/viewers/videoViewer/internal/theater-mode.js

26 lines
675 B
JavaScript
Raw Normal View History

2021-01-08 16:21:27 +01:00
// @flow
import type { Player } from './videojs';
import videojs from 'video.js';
class TheaterModeButton extends videojs.getComponent('Button') {
constructor(player, options = {}) {
super(player, options);
this.addClass('vjs-button--theater-mode');
this.controlText('Theater Mode');
}
}
2021-01-08 16:21:27 +01:00
export function addTheaterModeButton(player: Player, toggleVideoTheaterMode: () => void) {
const controlBar = player.getChild('controlBar');
const theaterMode = new TheaterModeButton(player, {
name: 'TheaterModeButton',
2021-01-08 16:21:27 +01:00
text: __('Theater mode'),
clickHandler: () => {
toggleVideoTheaterMode();
},
});
controlBar.addChild(theaterMode);
2021-01-08 16:21:27 +01:00
}