]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/assets/player/peertube-videojs-typings.ts
Revert "Fix context menu when watching a playlist"
[github/Chocobozzz/PeerTube.git] / client / src / assets / player / peertube-videojs-typings.ts
index a4e4c580c12c4eb5e7153b0846886ceefc3eb985..4a6c8024767cd20f15c45a1e941ba60315879fcf 100644 (file)
@@ -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<EndCardOptions>): void
+
+    playlist (): PlaylistPlugin
   }
 }
 
@@ -102,6 +106,26 @@ type PeerTubePluginOptions = {
   videoCaptions: VideoJSCaption[]
 
   stopTime: number | string
+
+  isLive: boolean
+
+  videoUUID: string
+}
+
+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 +148,8 @@ type P2PMediaLoaderPluginOptions = {
 }
 
 type VideoJSPluginOptions = {
+  playlist?: PlaylistPluginOptions
+
   peertube: PeerTubePluginOptions
 
   webtorrent?: WebtorrentPluginOptions
@@ -153,6 +179,8 @@ type AutoResolutionUpdateData = {
 }
 
 type PlayerNetworkInfo = {
+  source: 'webtorrent' | 'p2p-media-loader'
+
   http: {
     downloadSpeed: number
     uploadSpeed: number
@@ -169,10 +197,19 @@ type PlayerNetworkInfo = {
   }
 }
 
+type PlaylistItemOptions = {
+  element: VideoPlaylistElement
+
+  onClicked: Function
+}
+
 export {
   PlayerNetworkInfo,
+  PlaylistItemOptions,
+  NextPreviousVideoButtonOptions,
   ResolutionUpdateData,
   AutoResolutionUpdateData,
+  PlaylistPluginOptions,
   VideoJSCaption,
   UserWatching,
   PeerTubePluginOptions,