X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fassets%2Fplayer%2Fpeertube-videojs-typings.ts;h=bd6db4ffc69c0f2a3caadf8384c79a5bfb637bbb;hb=e367da949bb97c3db8c2f9a28ea09eef93abb2f5;hp=97828c8024931788f18a16fd2a6b234d8bcd80cb;hpb=4d3e611dd2764d1d5d0a7e777312631e1e7005d4;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/assets/player/peertube-videojs-typings.ts b/client/src/assets/player/peertube-videojs-typings.ts index 97828c802..bd6db4ffc 100644 --- a/client/src/assets/player/peertube-videojs-typings.ts +++ b/client/src/assets/player/peertube-videojs-typings.ts @@ -1,6 +1,3 @@ -// FIXME: lint -/* eslint-disable @typescript-eslint/ban-types */ - import { HlsConfig, Level } from 'hls.js' import videojs from 'video.js' import { VideoFile, VideoPlaylist, VideoPlaylistElement } from '@shared/models' @@ -8,11 +5,12 @@ 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' import { PeerTubePlugin } from './peertube-plugin' +import { PeerTubeResolutionsPlugin } from './peertube-resolutions-plugin' import { PlaylistPlugin } from './playlist/playlist-plugin' -import { EndCardOptions } from './upnext/end-card' import { StatsCardOptions } from './stats/stats-card' -import { WebTorrentPlugin } from './webtorrent/webtorrent-plugin' import { StatsForNerdsPlugin } from './stats/stats-plugin' +import { EndCardOptions } from './upnext/end-card' +import { WebTorrentPlugin } from './webtorrent/webtorrent-plugin' declare module 'video.js' { @@ -37,16 +35,15 @@ declare module 'video.js' { p2pMediaLoader (): P2pMediaLoaderPlugin + peertubeResolutions (): PeerTubeResolutionsPlugin + contextmenuUI (options: any): any bezels (): void stats (options?: StatsCardOptions): StatsForNerdsPlugin - qualityLevels (): QualityLevels - textTracks (): TextTrackList & { - on: Function tracks_: (TextTrack & { id: string, label: string, src: string })[] } @@ -69,24 +66,16 @@ export interface HlsjsConfigHandlerOptions { levelLabelHandler?: (level: Level) => string } -type QualityLevelRepresentation = { +type PeerTubeResolution = { id: number - height: number + height?: number label?: string width?: number - bandwidth?: number bitrate?: number - enabled?: Function - _enabled: boolean -} - -type QualityLevels = QualityLevelRepresentation[] & { - selectedIndex: number - selectedIndex_: number - - addQualityLevel (representation: QualityLevelRepresentation): void + selected: boolean + selectCallback: () => void } type VideoJSCaption = { @@ -131,7 +120,7 @@ type PlaylistPluginOptions = { type NextPreviousVideoButtonOptions = { type: 'next' | 'previous' - handler: Function + handler: () => void isDisabled: () => boolean } @@ -214,7 +203,7 @@ type PlayerNetworkInfo = { type PlaylistItemOptions = { element: VideoPlaylistElement - onClicked: Function + onClicked: () => void } export { @@ -229,9 +218,8 @@ export { PeerTubePluginOptions, WebtorrentPluginOptions, P2PMediaLoaderPluginOptions, + PeerTubeResolution, VideoJSPluginOptions, LoadedQualityData, - QualityLevelRepresentation, - PeerTubeLinkButtonOptions, - QualityLevels + PeerTubeLinkButtonOptions }