X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fassets%2Fplayer%2Fpeertube-videojs-typings.ts;h=e5259092c6cdfaac0a056d424f0288faada30062;hb=10f26f4203b8cef32778bf3435d8112eaea3c093;hp=a4e4c580c12c4eb5e7153b0846886ceefc3eb985;hpb=c2777c1dfe688c8fab1ef2fed50e360100fa9198;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 a4e4c580c..e5259092c 100644 --- a/client/src/assets/player/peertube-videojs-typings.ts +++ b/client/src/assets/player/peertube-videojs-typings.ts @@ -1,11 +1,13 @@ -import { PeerTubePlugin } from './peertube-plugin' -import { WebTorrentPlugin } from './webtorrent/webtorrent-plugin' +import { Config, Level } from 'hls.js' +import videojs from 'video.js' +import { VideoFile, VideoPlaylist, VideoPlaylistElement } from '@shared/models' import { P2pMediaLoaderPlugin } from './p2p-media-loader/p2p-media-loader-plugin' -import { PlayerMode } from './peertube-player-manager' import { RedundancyUrlManager } from './p2p-media-loader/redundancy-url-manager' -import { VideoFile } from '@shared/models' -import videojs from 'video.js' -import { Config, Level } from 'hls.js' +import { PlayerMode } from './peertube-player-manager' +import { PeerTubePlugin } from './peertube-plugin' +import { PlaylistPlugin } from './playlist/playlist-plugin' +import { EndCardOptions } from './upnext/end-card' +import { WebTorrentPlugin } from './webtorrent/webtorrent-plugin' declare module 'video.js' { @@ -38,12 +40,14 @@ declare module 'video.js' { textTracks (): TextTrackList & { on: Function - tracks_: { kind: string, mode: string, language: string }[] + tracks_: (TextTrack & { id: string, label: string, src: string })[] } - audioTracks (): AudioTrackList - dock (options: { title: string, description: string }): void + + upnext (options: Partial): void + + playlist (): PlaylistPlugin } } @@ -102,6 +106,24 @@ type PeerTubePluginOptions = { videoCaptions: VideoJSCaption[] stopTime: number | string + + isLive: boolean +} + +type PlaylistPluginOptions = { + elements: VideoPlaylistElement[] + + playlist: VideoPlaylist + + getCurrentPosition: () => number + + onItemClicked: (element: VideoPlaylistElement) => void +} + +type NextPreviousVideoButtonOptions = { + type: 'next' | 'previous' + handler: Function + isDisabled: () => boolean } type WebtorrentPluginOptions = { @@ -124,6 +146,8 @@ type P2PMediaLoaderPluginOptions = { } type VideoJSPluginOptions = { + playlist?: PlaylistPluginOptions + peertube: PeerTubePluginOptions webtorrent?: WebtorrentPluginOptions @@ -153,6 +177,8 @@ type AutoResolutionUpdateData = { } type PlayerNetworkInfo = { + source: 'webtorrent' | 'p2p-media-loader' + http: { downloadSpeed: number uploadSpeed: number @@ -169,10 +195,19 @@ type PlayerNetworkInfo = { } } +type PlaylistItemOptions = { + element: VideoPlaylistElement + + onClicked: Function +} + export { PlayerNetworkInfo, + PlaylistItemOptions, + NextPreviousVideoButtonOptions, ResolutionUpdateData, AutoResolutionUpdateData, + PlaylistPluginOptions, VideoJSCaption, UserWatching, PeerTubePluginOptions,