1
0
Fork 0

Fix some old typing issues

This commit is contained in:
Chocobozzz 2021-10-22 16:18:00 +02:00
parent 60dd77c692
commit 02b2e482e0
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
7 changed files with 10 additions and 15 deletions

View File

@ -68,10 +68,6 @@ function hlsjsConfigHandler (this: videojs.Player, options: HlsjsConfigHandlerOp
player.srOptions_.hlsjsConfig = options.hlsjsConfig player.srOptions_.hlsjsConfig = options.hlsjsConfig
} }
if (!player.srOptions_.captionConfig) {
player.srOptions_.captionConfig = options.captionConfig
}
if (options.levelLabelHandler && !player.srOptions_.levelLabelHandler) { if (options.levelLabelHandler && !player.srOptions_.levelLabelHandler) {
player.srOptions_.levelLabelHandler = options.levelLabelHandler player.srOptions_.levelLabelHandler = options.levelLabelHandler
} }

View File

@ -89,8 +89,7 @@ class P2pMediaLoaderPlugin extends Plugin {
} }
getLiveLatency () { getLiveLatency () {
// FIXME: typings return Math.round(this.hlsjs.latency)
return Math.round((this.hlsjs as any).latency)
} }
getHLSJS () { getHLSJS () {
@ -113,7 +112,7 @@ class P2pMediaLoaderPlugin extends Plugin {
initHlsJsPlayer(this.hlsjs) initHlsJsPlayer(this.hlsjs)
// FIXME: typings // 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 = options.hlsjsConfig.loader.getEngine()
this.p2pEngine.on(Events.SegmentError, (segment: Segment, err) => { this.p2pEngine.on(Events.SegmentError, (segment: Segment, err) => {

View File

@ -1,6 +1,7 @@
import { HlsConfig, Level } from 'hls.js' import { HlsConfig, Level } from 'hls.js'
import videojs from 'video.js' import videojs from 'video.js'
import { VideoFile, VideoPlaylist, VideoPlaylistElement } from '@shared/models' 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 { P2pMediaLoaderPlugin } from './p2p-media-loader/p2p-media-loader-plugin'
import { RedundancyUrlManager } from './p2p-media-loader/redundancy-url-manager' import { RedundancyUrlManager } from './p2p-media-loader/redundancy-url-manager'
import { PlayerMode } from './peertube-player-manager' import { PlayerMode } from './peertube-player-manager'
@ -56,12 +57,11 @@ declare module 'video.js' {
} }
export interface VideoJSTechHLS extends videojs.Tech { export interface VideoJSTechHLS extends videojs.Tech {
hlsProvider: any // FIXME: typings hlsProvider: Html5Hlsjs
} }
export interface HlsjsConfigHandlerOptions { export interface HlsjsConfigHandlerOptions {
hlsjsConfig?: HlsConfig & { cueHandler: any }// FIXME: typings hlsjsConfig?: HlsConfig
captionConfig?: any // FIXME: typings
levelLabelHandler?: (level: Level) => string levelLabelHandler?: (level: Level) => string
} }

View File

@ -25,7 +25,6 @@ class PeerTubeLoadProgressBar extends Component {
const torrent = this.player().webtorrent().getTorrent() const torrent = this.player().webtorrent().getTorrent()
if (!torrent) return if (!torrent) return
// FIXME: typings
(this.el() as HTMLElement).style.width = (torrent.progress * 100) + '%' (this.el() as HTMLElement).style.width = (torrent.progress * 100) + '%'
} }

View File

@ -56,7 +56,7 @@ class SettingsMenuItem extends MenuItem {
const newOptions = Object.assign({}, options, { entry: options.menuButton, menuButton: this }) 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] const subMenuClass = this.subMenu.buildCSSClass().split(' ')[0]
this.settingsSubMenuEl_.className += ' ' + subMenuClass this.settingsSubMenuEl_.className += ' ' + subMenuClass

View File

@ -264,8 +264,10 @@
font-size: 15px; font-size: 15px;
height: $button-height; height: $button-height;
line-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; border-radius: 3px !important;
text-align: center; text-align: center;
cursor: pointer; cursor: pointer;
} }

View File

@ -53,8 +53,7 @@ $sub-menu-height: 81px;
$channel-background-color: #f6ede8; $channel-background-color: #f6ede8;
// FIXME: cannot use math.div here because of compilation error $banner-inverted-ratio: math.div(1, 6);
$banner-inverted-ratio: 0.1666666666;
$max-channels-width: 1200px; $max-channels-width: 1200px;