]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/assets/player/types/manager-options.ts
Prevent invalid end watch section warnings
[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 playbackRate?: number | string
34 }
35
36 export interface CommonOptions extends CustomizationOptions {
37 playerElement: HTMLVideoElement
38 onPlayerElementChange: (element: HTMLVideoElement) => void
39
40 autoplay: boolean
41 forceAutoplay: boolean
42
43 p2pEnabled: boolean
44
45 nextVideo?: () => void
46 hasNextVideo?: () => boolean
47
48 previousVideo?: () => void
49 hasPreviousVideo?: () => boolean
50
51 playlist?: PlaylistPluginOptions
52
53 videoDuration: number
54 enableHotkeys: boolean
55 inactivityTimeout: number
56 poster: string
57
58 videoViewIntervalMs: number
59
60 instanceName: string
61
62 theaterButton: boolean
63 captions: boolean
64
65 videoViewUrl: string
66 authorizationHeader?: () => string
67
68 metricsUrl: string
69
70 embedUrl: string
71 embedTitle: string
72
73 isLive: boolean
74 liveOptions?: {
75 latencyMode: LiveVideoLatencyMode
76 }
77
78 language?: string
79
80 videoCaptions: VideoJSCaption[]
81
82 videoUUID: string
83 videoShortUUID: string
84
85 serverUrl: string
86 requiresAuth: boolean
87 videoFileToken: () => string
88
89 errorNotifier: (message: string) => void
90 }
91
92 export type PeertubePlayerManagerOptions = {
93 common: CommonOptions
94 webtorrent: WebtorrentOptions
95 p2pMediaLoader?: P2PMediaLoaderOptions
96
97 pluginsManager: PluginsManager
98 }