lbry-desktop/ui/component/viewers/videoViewer/internal/play-next.js
2021-08-25 15:27:09 -04:00

25 lines
637 B
JavaScript

// @flow
import type { Player } from './videojs';
import videojs from 'video.js';
class PlayNextButton extends videojs.getComponent('Button') {
constructor(player, options = {}) {
super(player, options);
this.addClass('vjs-button--play-next');
this.controlText('Play Next');
}
}
export function addPlayNextButton(player: Player, playNextURI: () => void) {
const controlBar = player.getChild('controlBar');
const playNext = new PlayNextButton(player, {
name: __('PlayNextButton'),
text: __('Play Next'),
clickHandler: () => {
playNextURI();
},
});
controlBar.addChild(playNext, {}, 1);
}