]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/assets/player/types/manager-options.ts
More robust player stats card
[github/Chocobozzz/PeerTube.git] / client / src / assets / player / types / manager-options.ts
CommitLineData
9597920e
C
1import { PluginsManager } from '@root-helpers/plugins-manager'
2import { LiveVideoLatencyMode, VideoFile } from '@shared/models'
384ba8b7 3import { PlaylistPluginOptions, VideoJSCaption } from './peertube-videojs-typings'
9597920e
C
4
5export type PlayerMode = 'webtorrent' | 'p2p-media-loader'
6
7export type WebtorrentOptions = {
8 videoFiles: VideoFile[]
9}
10
11export type P2PMediaLoaderOptions = {
12 playlistUrl: string
13 segmentsSha256Url: string
14 trackerAnnounce: string[]
15 redundancyBaseUrls: string[]
16 videoFiles: VideoFile[]
17}
18
19export interface CustomizationOptions {
20 startTime: number | string
21 stopTime: number | string
22
23 controls?: boolean
60f013e1
C
24 controlBar?: boolean
25
9597920e
C
26 muted?: boolean
27 loop?: boolean
28 subtitle?: string
29 resume?: string
30
31 peertubeLink: boolean
0e08a5e7 32
33 playbackRate: number | string
9597920e
C
34}
35
36export interface CommonOptions extends CustomizationOptions {
37 playerElement: HTMLVideoElement
38 onPlayerElementChange: (element: HTMLVideoElement) => void
39
40 autoplay: boolean
59a643aa
C
41 forceAutoplay: boolean
42
9597920e
C
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
bd2b51be
C
58 instanceName: string
59
9597920e
C
60 theaterButton: boolean
61 captions: boolean
62
63 videoViewUrl: string
3545e72c 64 authorizationHeader?: () => string
384ba8b7 65
fd3c2e87
C
66 metricsUrl: string
67
9597920e
C
68 embedUrl: string
69 embedTitle: string
70
71 isLive: boolean
72 liveOptions?: {
73 latencyMode: LiveVideoLatencyMode
74 }
75
76 language?: string
77
78 videoCaptions: VideoJSCaption[]
79
80 videoUUID: string
81 videoShortUUID: string
82
9597920e 83 serverUrl: string
3545e72c
C
84 requiresAuth: boolean
85 videoFileToken: () => string
9597920e
C
86
87 errorNotifier: (message: string) => void
88}
89
90export type PeertubePlayerManagerOptions = {
91 common: CommonOptions
92 webtorrent: WebtorrentOptions
93 p2pMediaLoader?: P2PMediaLoaderOptions
94
95 pluginsManager: PluginsManager
96}