]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/assets/player/types/manager-options.ts
Add control bar option for peertube player
[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
32}
33
34export interface CommonOptions extends CustomizationOptions {
35 playerElement: HTMLVideoElement
36 onPlayerElementChange: (element: HTMLVideoElement) => void
37
38 autoplay: boolean
39 p2pEnabled: boolean
40
41 nextVideo?: () => void
42 hasNextVideo?: () => boolean
43
44 previousVideo?: () => void
45 hasPreviousVideo?: () => boolean
46
47 playlist?: PlaylistPluginOptions
48
49 videoDuration: number
50 enableHotkeys: boolean
51 inactivityTimeout: number
52 poster: string
53
54 theaterButton: boolean
55 captions: boolean
56
57 videoViewUrl: string
384ba8b7
C
58 authorizationHeader?: string
59
9597920e
C
60 embedUrl: string
61 embedTitle: string
62
63 isLive: boolean
64 liveOptions?: {
65 latencyMode: LiveVideoLatencyMode
66 }
67
68 language?: string
69
70 videoCaptions: VideoJSCaption[]
71
72 videoUUID: string
73 videoShortUUID: string
74
9597920e
C
75 serverUrl: string
76
77 errorNotifier: (message: string) => void
78}
79
80export type PeertubePlayerManagerOptions = {
81 common: CommonOptions
82 webtorrent: WebtorrentOptions
83 p2pMediaLoader?: P2PMediaLoaderOptions
84
85 pluginsManager: PluginsManager
86}