X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fassets%2Fplayer%2Fpeertube-videojs-typings.ts;h=246f0d390c76984379b6d4b8c40dcba988e37485;hb=ba8a8367e7fde7915ae6633445bf46ebf4a9fe94;hp=4a6c8024767cd20f15c45a1e941ba60315879fcf;hpb=4024c44f9027a32809931de0692d40d001df721c;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 4a6c80247..246f0d390 100644 --- a/client/src/assets/player/peertube-videojs-typings.ts +++ b/client/src/assets/player/peertube-videojs-typings.ts @@ -1,11 +1,15 @@ -import { Config, Level } from 'hls.js' +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 { StatsCardOptions } from './stats/stats-card' +import { StatsForNerdsPlugin } from './stats/stats-plugin' import { EndCardOptions } from './upnext/end-card' import { WebTorrentPlugin } from './webtorrent/webtorrent-plugin' @@ -32,14 +36,17 @@ declare module 'video.js' { p2pMediaLoader (): P2pMediaLoaderPlugin + peertubeResolutions (): PeerTubeResolutionsPlugin + contextmenuUI (options: any): any bezels (): void + peertubeMobile (): void + peerTubeHotkeysPlugin (): void - qualityLevels (): QualityLevels + stats (options?: StatsCardOptions): StatsForNerdsPlugin textTracks (): TextTrackList & { - on: Function tracks_: (TextTrack & { id: string, label: string, src: string })[] } @@ -52,34 +59,25 @@ declare module 'video.js' { } export interface VideoJSTechHLS extends videojs.Tech { - hlsProvider: any // FIXME: typings + hlsProvider: Html5Hlsjs } export interface HlsjsConfigHandlerOptions { - hlsjsConfig?: Config & { 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 = { @@ -89,7 +87,7 @@ type VideoJSCaption = { } type UserWatching = { - url: string, + url: string authorizationHeader: string } @@ -124,10 +122,18 @@ type PlaylistPluginOptions = { type NextPreviousVideoButtonOptions = { type: 'next' | 'previous' - handler: Function + handler: () => void isDisabled: () => boolean } +type PeerTubeLinkButtonOptions = { + shortUUID: string +} + +type PeerTubeP2PInfoButtonOptions = { + p2pEnabled: boolean +} + type WebtorrentPluginOptions = { playerElement: HTMLVideoElement @@ -137,6 +143,8 @@ type WebtorrentPluginOptions = { videoFiles: VideoFile[] startTime: number | string + + playerRefusedP2P: boolean } type P2PMediaLoaderPluginOptions = { @@ -158,7 +166,7 @@ type VideoJSPluginOptions = { } type LoadedQualityData = { - qualitySwitchCallback: Function, + qualitySwitchCallback: (resolutionId: number, type: 'video') => void qualityData: { video: { id: number @@ -169,7 +177,7 @@ type LoadedQualityData = { } type ResolutionUpdateData = { - auto: boolean, + auto: boolean resolutionId: number id?: number } @@ -195,12 +203,15 @@ type PlayerNetworkInfo = { uploaded: number numPeers: number } + + // In bytes + bandwidthEstimate: number } type PlaylistItemOptions = { element: VideoPlaylistElement - onClicked: Function + onClicked: () => void } export { @@ -215,8 +226,9 @@ export { PeerTubePluginOptions, WebtorrentPluginOptions, P2PMediaLoaderPluginOptions, + PeerTubeResolution, VideoJSPluginOptions, LoadedQualityData, - QualityLevelRepresentation, - QualityLevels + PeerTubeLinkButtonOptions, + PeerTubeP2PInfoButtonOptions }