]>
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 | ||
9597920e C |
62 | embedUrl: string |
63 | embedTitle: string | |
64 | ||
65 | isLive: boolean | |
66 | liveOptions?: { | |
67 | latencyMode: LiveVideoLatencyMode | |
68 | } | |
69 | ||
70 | language?: string | |
71 | ||
72 | videoCaptions: VideoJSCaption[] | |
73 | ||
74 | videoUUID: string | |
75 | videoShortUUID: string | |
76 | ||
9597920e C |
77 | serverUrl: string |
78 | ||
79 | errorNotifier: (message: string) => void | |
80 | } | |
81 | ||
82 | export type PeertubePlayerManagerOptions = { | |
83 | common: CommonOptions | |
84 | webtorrent: WebtorrentOptions | |
85 | p2pMediaLoader?: P2PMediaLoaderOptions | |
86 | ||
87 | pluginsManager: PluginsManager | |
88 | } |