]>
Commit | Line | Data |
---|---|---|
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 | instanceName: string | |
59 | ||
60 | theaterButton: boolean | |
61 | captions: boolean | |
62 | ||
63 | videoViewUrl: string | |
64 | authorizationHeader?: () => string | |
65 | ||
66 | metricsUrl: string | |
67 | ||
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 | ||
83 | serverUrl: string | |
84 | requiresAuth: boolean | |
85 | videoFileToken: () => string | |
86 | ||
87 | errorNotifier: (message: string) => void | |
88 | } | |
89 | ||
90 | export type PeertubePlayerManagerOptions = { | |
91 | common: CommonOptions | |
92 | webtorrent: WebtorrentOptions | |
93 | p2pMediaLoader?: P2PMediaLoaderOptions | |
94 | ||
95 | pluginsManager: PluginsManager | |
96 | } |