From 02b2e482e0bdf16432b1ee34e95a71bbad39a4ff Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 22 Oct 2021 16:18:00 +0200 Subject: [PATCH] Fix some old typing issues --- client/src/assets/player/p2p-media-loader/hls-plugin.ts | 4 ---- .../player/p2p-media-loader/p2p-media-loader-plugin.ts | 5 ++--- client/src/assets/player/peertube-videojs-typings.ts | 6 +++--- .../player/videojs-components/peertube-load-progress-bar.ts | 1 - .../assets/player/videojs-components/settings-menu-item.ts | 2 +- client/src/sass/include/_mixins.scss | 4 +++- client/src/sass/include/_variables.scss | 3 +-- 7 files changed, 10 insertions(+), 15 deletions(-) diff --git a/client/src/assets/player/p2p-media-loader/hls-plugin.ts b/client/src/assets/player/p2p-media-loader/hls-plugin.ts index 17b9aba97..71c31696a 100644 --- a/client/src/assets/player/p2p-media-loader/hls-plugin.ts +++ b/client/src/assets/player/p2p-media-loader/hls-plugin.ts @@ -68,10 +68,6 @@ function hlsjsConfigHandler (this: videojs.Player, options: HlsjsConfigHandlerOp player.srOptions_.hlsjsConfig = options.hlsjsConfig } - if (!player.srOptions_.captionConfig) { - player.srOptions_.captionConfig = options.captionConfig - } - if (options.levelLabelHandler && !player.srOptions_.levelLabelHandler) { player.srOptions_.levelLabelHandler = options.levelLabelHandler } diff --git a/client/src/assets/player/p2p-media-loader/p2p-media-loader-plugin.ts b/client/src/assets/player/p2p-media-loader/p2p-media-loader-plugin.ts index d917fda03..f8e5e2d6b 100644 --- a/client/src/assets/player/p2p-media-loader/p2p-media-loader-plugin.ts +++ b/client/src/assets/player/p2p-media-loader/p2p-media-loader-plugin.ts @@ -89,8 +89,7 @@ class P2pMediaLoaderPlugin extends Plugin { } getLiveLatency () { - // FIXME: typings - return Math.round((this.hlsjs as any).latency) + return Math.round(this.hlsjs.latency) } getHLSJS () { @@ -113,7 +112,7 @@ class P2pMediaLoaderPlugin extends Plugin { initHlsJsPlayer(this.hlsjs) // FIXME: typings - const options = this.player.tech(true).options_ as any + const options = (this.player.tech(true).options_ as any) this.p2pEngine = options.hlsjsConfig.loader.getEngine() this.p2pEngine.on(Events.SegmentError, (segment: Segment, err) => { diff --git a/client/src/assets/player/peertube-videojs-typings.ts b/client/src/assets/player/peertube-videojs-typings.ts index bd6db4ffc..ea39ac44d 100644 --- a/client/src/assets/player/peertube-videojs-typings.ts +++ b/client/src/assets/player/peertube-videojs-typings.ts @@ -1,6 +1,7 @@ import { HlsConfig, Level } from 'hls.js' import videojs from 'video.js' import { VideoFile, VideoPlaylist, VideoPlaylistElement } from '@shared/models' +import { Html5Hlsjs } from './p2p-media-loader/hls-plugin' import { P2pMediaLoaderPlugin } from './p2p-media-loader/p2p-media-loader-plugin' import { RedundancyUrlManager } from './p2p-media-loader/redundancy-url-manager' import { PlayerMode } from './peertube-player-manager' @@ -56,12 +57,11 @@ declare module 'video.js' { } export interface VideoJSTechHLS extends videojs.Tech { - hlsProvider: any // FIXME: typings + hlsProvider: Html5Hlsjs } export interface HlsjsConfigHandlerOptions { - hlsjsConfig?: HlsConfig & { cueHandler: any }// FIXME: typings - captionConfig?: any // FIXME: typings + hlsjsConfig?: HlsConfig levelLabelHandler?: (level: Level) => string } diff --git a/client/src/assets/player/videojs-components/peertube-load-progress-bar.ts b/client/src/assets/player/videojs-components/peertube-load-progress-bar.ts index 7869b56ce..623e70eb2 100644 --- a/client/src/assets/player/videojs-components/peertube-load-progress-bar.ts +++ b/client/src/assets/player/videojs-components/peertube-load-progress-bar.ts @@ -25,7 +25,6 @@ class PeerTubeLoadProgressBar extends Component { const torrent = this.player().webtorrent().getTorrent() if (!torrent) return - // FIXME: typings (this.el() as HTMLElement).style.width = (torrent.progress * 100) + '%' } diff --git a/client/src/assets/player/videojs-components/settings-menu-item.ts b/client/src/assets/player/videojs-components/settings-menu-item.ts index d27163373..67e71b4e2 100644 --- a/client/src/assets/player/videojs-components/settings-menu-item.ts +++ b/client/src/assets/player/videojs-components/settings-menu-item.ts @@ -56,7 +56,7 @@ class SettingsMenuItem extends MenuItem { const newOptions = Object.assign({}, options, { entry: options.menuButton, menuButton: this }) - this.subMenu = new SubMenuComponent(this.player(), newOptions) as any // FIXME: typings + this.subMenu = new SubMenuComponent(this.player(), newOptions) as SettingsButton const subMenuClass = this.subMenu.buildCSSClass().split(' ')[0] this.settingsSubMenuEl_.className += ' ' + subMenuClass diff --git a/client/src/sass/include/_mixins.scss b/client/src/sass/include/_mixins.scss index fedc022e0..6055ce53c 100644 --- a/client/src/sass/include/_mixins.scss +++ b/client/src/sass/include/_mixins.scss @@ -264,8 +264,10 @@ font-size: 15px; height: $button-height; line-height: $button-height; - // FIXME: because of primeng that redefines border-radius of all input[type="..."] + + // Because of primeng that redefines border-radius of all input[type="..."] border-radius: 3px !important; + text-align: center; cursor: pointer; } diff --git a/client/src/sass/include/_variables.scss b/client/src/sass/include/_variables.scss index f973b3257..e1d3716dd 100644 --- a/client/src/sass/include/_variables.scss +++ b/client/src/sass/include/_variables.scss @@ -53,8 +53,7 @@ $sub-menu-height: 81px; $channel-background-color: #f6ede8; -// FIXME: cannot use math.div here because of compilation error -$banner-inverted-ratio: 0.1666666666; +$banner-inverted-ratio: math.div(1, 6); $max-channels-width: 1200px;