]>
Commit | Line | Data |
---|---|---|
9597920e C |
1 | import { PluginsManager } from '@root-helpers/plugins-manager' |
2 | import { LiveVideoLatencyMode, VideoFile } from '@shared/models' | |
384ba8b7 | 3 | import { PlaylistPluginOptions, VideoJSCaption } from './peertube-videojs-typings' |
9597920e C |
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 | |
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 | ||
34 | export 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 | ||
bd2b51be C |
54 | instanceName: string |
55 | ||
9597920e C |
56 | theaterButton: boolean |
57 | captions: boolean | |
58 | ||
59 | videoViewUrl: string | |
384ba8b7 C |
60 | authorizationHeader?: string |
61 | ||
fd3c2e87 C |
62 | metricsUrl: string |
63 | ||
9597920e C |
64 | embedUrl: string |
65 | embedTitle: string | |
66 | ||
67 | isLive: boolean | |
68 | liveOptions?: { | |
69 | latencyMode: LiveVideoLatencyMode | |
70 | } | |
71 | ||
72 | language?: string | |
73 | ||
74 | videoCaptions: VideoJSCaption[] | |
75 | ||
76 | videoUUID: string | |
77 | videoShortUUID: string | |
78 | ||
9597920e C |
79 | serverUrl: string |
80 | ||
81 | errorNotifier: (message: string) => void | |
82 | } | |
83 | ||
84 | export type PeertubePlayerManagerOptions = { | |
85 | common: CommonOptions | |
86 | webtorrent: WebtorrentOptions | |
87 | p2pMediaLoader?: P2PMediaLoaderOptions | |
88 | ||
89 | pluginsManager: PluginsManager | |
90 | } |