X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fassets%2Fplayer%2Fpeertube-videojs-typings.ts;h=246f0d390c76984379b6d4b8c40dcba988e37485;hb=ba8a8367e7fde7915ae6633445bf46ebf4a9fe94;hp=97828c8024931788f18a16fd2a6b234d8bcd80cb;hpb=9df52d660feb722404be00a50f3c8a612bec1c15;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..246f0d390 100644 --- a/client/src/assets/player/peertube-videojs-typings.ts +++ b/client/src/assets/player/peertube-videojs-typings.ts @@ -1,18 +1,17 @@ -// 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' +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' +import { PlayerMode } from './peertube-player-options-builder' 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 +36,17 @@ declare module 'video.js' { p2pMediaLoader (): P2pMediaLoaderPlugin + peertubeResolutions (): PeerTubeResolutionsPlugin + contextmenuUI (options: any): any bezels (): void + peertubeMobile (): void + peerTubeHotkeysPlugin (): void stats (options?: StatsCardOptions): StatsForNerdsPlugin - qualityLevels (): QualityLevels - textTracks (): TextTrackList & { - on: Function tracks_: (TextTrack & { id: string, label: string, src: string })[] } @@ -59,34 +59,25 @@ 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 } -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 +122,7 @@ type PlaylistPluginOptions = { type NextPreviousVideoButtonOptions = { type: 'next' | 'previous' - handler: Function + handler: () => void isDisabled: () => boolean } @@ -139,6 +130,10 @@ type PeerTubeLinkButtonOptions = { shortUUID: string } +type PeerTubeP2PInfoButtonOptions = { + p2pEnabled: boolean +} + type WebtorrentPluginOptions = { playerElement: HTMLVideoElement @@ -148,6 +143,8 @@ type WebtorrentPluginOptions = { videoFiles: VideoFile[] startTime: number | string + + playerRefusedP2P: boolean } type P2PMediaLoaderPluginOptions = { @@ -214,7 +211,7 @@ type PlayerNetworkInfo = { type PlaylistItemOptions = { element: VideoPlaylistElement - onClicked: Function + onClicked: () => void } export { @@ -229,9 +226,9 @@ export { PeerTubePluginOptions, WebtorrentPluginOptions, P2PMediaLoaderPluginOptions, + PeerTubeResolution, VideoJSPluginOptions, LoadedQualityData, - QualityLevelRepresentation, PeerTubeLinkButtonOptions, - QualityLevels + PeerTubeP2PInfoButtonOptions }