]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/assets/player/types/manager-options.ts
Merge branch 'release/5.0.0' into develop
[github/Chocobozzz/PeerTube.git] / client / src / assets / player / types / manager-options.ts
1 import { PluginsManager } from '@root-helpers/plugins-manager'
2 import { LiveVideoLatencyMode, VideoFile } from '@shared/models'
3 import { PlaylistPluginOptions, VideoJSCaption } from './peertube-videojs-typings'
4
5 export type PlayerMode = 'webtorrent' | 'p2p-media-loader'
6
7 export type WebtorrentOptions = {
8 videoFiles: VideoFile[]
9 }
10
11 export type P2PMediaLoaderOptions = {
12 playlistUrl: string
13 segmentsSha256Url: string
14 trackerAnnounce: string[]
15 redundancyBaseUrls: string[]
16 videoFiles: VideoFile[]
17 }
18
19 export interface CustomizationOptions {
20 startTime: number | string
21 stopTime: number | string
22
23 controls?: boolean
24 controlBar?: boolean
25
26 muted?: boolean
27 loop?: boolean
28 subtitle?: string
29 resume?: string
30
31 peertubeLink: boolean
32 }
33
34 export interface CommonOptions extends CustomizationOptions {
35 playerElement: HTMLVideoElement
36 onPlayerElementChange: (element: HTMLVideoElement) => void
37
38 autoplay: boolean
39 forceAutoplay: boolean
40
41 p2pEnabled: boolean
42
43 nextVideo?: () => void
44 hasNextVideo?: () => boolean
45
46 previousVideo?: () => void
47 hasPreviousVideo?: () => boolean
48
49 playlist?: PlaylistPluginOptions
50
51 videoDuration: number
52 enableHotkeys: boolean
53 inactivityTimeout: number
54 poster: string
55
56 instanceName: string
57
58 theaterButton: boolean
59 captions: boolean
60
61 videoViewUrl: string
62 authorizationHeader?: () => string
63
64 metricsUrl: string
65
66 embedUrl: string
67 embedTitle: string
68
69 isLive: boolean
70 liveOptions?: {
71 latencyMode: LiveVideoLatencyMode
72 }
73
74 language?: string
75
76 videoCaptions: VideoJSCaption[]
77
78 videoUUID: string
79 videoShortUUID: string
80
81 serverUrl: string
82 requiresAuth: boolean
83 videoFileToken: () => string
84
85 errorNotifier: (message: string) => void
86 }
87
88 export type PeertubePlayerManagerOptions = {
89 common: CommonOptions
90 webtorrent: WebtorrentOptions
91 p2pMediaLoader?: P2PMediaLoaderOptions
92
93 pluginsManager: PluginsManager
94 }