From 3ec8dc096276ac3c7e5d8dca5f100017516f62ec Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 1 Mar 2018 19:02:51 +0100 Subject: Cleaner videojs control bar implementation --- client/src/assets/player/peertube-videojs-plugin.ts | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'client/src/assets') diff --git a/client/src/assets/player/peertube-videojs-plugin.ts b/client/src/assets/player/peertube-videojs-plugin.ts index 3b366ec9b..86cb858e2 100644 --- a/client/src/assets/player/peertube-videojs-plugin.ts +++ b/client/src/assets/player/peertube-videojs-plugin.ts @@ -22,7 +22,6 @@ interface VideoJSComponentInterface { type PeertubePluginOptions = { videoFiles: VideoFile[] playerElement: HTMLVideoElement - peerTubeLink: boolean videoViewUrl: string videoDuration: number } @@ -120,7 +119,7 @@ class ResolutionMenuButton extends MenuButton { MenuButton.registerComponent('ResolutionMenuButton', ResolutionMenuButton) const Button: VideoJSComponentInterface = videojsUntyped.getComponent('Button') -class PeertubeLinkButton extends Button { +class PeerTubeLinkButton extends Button { createEl () { const link = document.createElement('a') @@ -141,7 +140,7 @@ class PeertubeLinkButton extends Button { this.parentNode.removeChild(this) } } -Button.registerComponent('PeerTubeLinkButton', PeertubeLinkButton) +Button.registerComponent('PeerTubeLinkButton', PeerTubeLinkButton) class WebTorrentButton extends Button { createEl () { @@ -392,20 +391,6 @@ class PeerTubePlugin extends Plugin { } private initializePlayer (options: PeertubePluginOptions) { - const controlBar = this.player.controlBar - - const menuButton = new ResolutionMenuButton(this.player, options) - const fullscreenElement = controlBar.fullscreenToggle.el() - controlBar.resolutionSwitcher = controlBar.el().insertBefore(menuButton.el(), fullscreenElement) - - if (options.peerTubeLink === true) { - const peerTubeLinkButton = new PeertubeLinkButton(this.player) - controlBar.peerTubeLink = controlBar.el().insertBefore(peerTubeLinkButton.el(), fullscreenElement) - } - - const webTorrentButton = new WebTorrentButton(this.player) - controlBar.webTorrent = controlBar.el().insertBefore(webTorrentButton.el(), controlBar.progressControl.el()) - if (this.autoplay === true) { this.updateVideoFile(undefined, () => this.player.play()) } else { -- cgit v1.2.3