]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/assets/player/types/peertube-videojs-typings.ts
Support reinjecting token in private m3u8 playlist
[github/Chocobozzz/PeerTube.git] / client / src / assets / player / types / peertube-videojs-typings.ts
index d9a388681ff9381ed9b32251e3eb36934d2e2d05..c60154f3b6369d642ceb2da495cb5540f9a58ba5 100644 (file)
@@ -88,23 +88,20 @@ type VideoJSCaption = {
   src: string
 }
 
-type UserWatching = {
-  url: string
-  authorizationHeader: string
-}
-
 type PeerTubePluginOptions = {
   mode: PlayerMode
 
-  autoplay: boolean
-  videoViewUrl: string
+  autoplay: videojs.Autoplay
   videoDuration: number
 
-  userWatching?: UserWatching
+  videoViewUrl: string
+  authorizationHeader?: () => string
+
   subtitle?: string
 
   videoCaptions: VideoJSCaption[]
 
+  startTime: number | string
   stopTime: number | string
 
   isLive: boolean
@@ -112,6 +109,12 @@ type PeerTubePluginOptions = {
   videoUUID: string
 }
 
+type MetricsPluginOptions = {
+  mode: PlayerMode
+  metricsUrl: string
+  videoUUID: string
+}
+
 type PlaylistPluginOptions = {
   elements: VideoPlaylistElement[]
 
@@ -130,6 +133,7 @@ type NextPreviousVideoButtonOptions = {
 
 type PeerTubeLinkButtonOptions = {
   shortUUID: string
+  instanceName: string
 }
 
 type PeerTubeP2PInfoButtonOptions = {
@@ -139,7 +143,7 @@ type PeerTubeP2PInfoButtonOptions = {
 type WebtorrentPluginOptions = {
   playerElement: HTMLVideoElement
 
-  autoplay: boolean
+  autoplay: videojs.Autoplay
   videoDuration: number
 
   videoFiles: VideoFile[]
@@ -147,6 +151,11 @@ type WebtorrentPluginOptions = {
   startTime: number | string
 
   playerRefusedP2P: boolean
+
+  requiresAuth: boolean
+  videoFileToken: () => string
+
+  buildWebSeedUrls: (file: VideoFile) => string[]
 }
 
 type P2PMediaLoaderPluginOptions = {
@@ -157,6 +166,9 @@ type P2PMediaLoaderPluginOptions = {
   startTime: number | string
 
   loader: P2PMediaLoader
+
+  requiresAuth: boolean
+  videoFileToken: () => string
 }
 
 export type P2PMediaLoader = {
@@ -167,6 +179,7 @@ type VideoJSPluginOptions = {
   playlist?: PlaylistPluginOptions
 
   peertube: PeerTubePluginOptions
+  metrics: MetricsPluginOptions
 
   webtorrent?: WebtorrentPluginOptions
 
@@ -199,9 +212,7 @@ type PlayerNetworkInfo = {
 
   http: {
     downloadSpeed: number
-    uploadSpeed: number
     downloaded: number
-    uploaded: number
   }
 
   p2p: {
@@ -229,8 +240,8 @@ export {
   ResolutionUpdateData,
   AutoResolutionUpdateData,
   PlaylistPluginOptions,
+  MetricsPluginOptions,
   VideoJSCaption,
-  UserWatching,
   PeerTubePluginOptions,
   WebtorrentPluginOptions,
   P2PMediaLoaderPluginOptions,