diff options
author | Chocobozzz <me@florianbigard.com> | 2022-03-14 11:16:54 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-03-14 11:36:38 +0100 |
commit | 9597920ee3d4ac99803e7107983ddf98a9dfb3c4 (patch) | |
tree | 62c98909b4eb30ece3c0f58c26c8555e6bef1e31 /client/src/assets/player/manager-options/manager-options.model.ts | |
parent | 9af2accee68082e4e1160a4e4a7036451262be02 (diff) | |
download | PeerTube-9597920ee3d4ac99803e7107983ddf98a9dfb3c4.tar.gz PeerTube-9597920ee3d4ac99803e7107983ddf98a9dfb3c4.tar.zst PeerTube-9597920ee3d4ac99803e7107983ddf98a9dfb3c4.zip |
Reorganize player manager options builder
Diffstat (limited to 'client/src/assets/player/manager-options/manager-options.model.ts')
-rw-r--r-- | client/src/assets/player/manager-options/manager-options.model.ts | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/client/src/assets/player/manager-options/manager-options.model.ts b/client/src/assets/player/manager-options/manager-options.model.ts new file mode 100644 index 000000000..0b0f8b435 --- /dev/null +++ b/client/src/assets/player/manager-options/manager-options.model.ts | |||
@@ -0,0 +1,84 @@ | |||
1 | import { PluginsManager } from '@root-helpers/plugins-manager' | ||
2 | import { LiveVideoLatencyMode, VideoFile } from '@shared/models' | ||
3 | import { PlaylistPluginOptions, UserWatching, 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 | muted?: boolean | ||
25 | loop?: boolean | ||
26 | subtitle?: string | ||
27 | resume?: string | ||
28 | |||
29 | peertubeLink: boolean | ||
30 | } | ||
31 | |||
32 | export interface CommonOptions extends CustomizationOptions { | ||
33 | playerElement: HTMLVideoElement | ||
34 | onPlayerElementChange: (element: HTMLVideoElement) => void | ||
35 | |||
36 | autoplay: boolean | ||
37 | p2pEnabled: boolean | ||
38 | |||
39 | nextVideo?: () => void | ||
40 | hasNextVideo?: () => boolean | ||
41 | |||
42 | previousVideo?: () => void | ||
43 | hasPreviousVideo?: () => boolean | ||
44 | |||
45 | playlist?: PlaylistPluginOptions | ||
46 | |||
47 | videoDuration: number | ||
48 | enableHotkeys: boolean | ||
49 | inactivityTimeout: number | ||
50 | poster: string | ||
51 | |||
52 | theaterButton: boolean | ||
53 | captions: boolean | ||
54 | |||
55 | videoViewUrl: string | ||
56 | embedUrl: string | ||
57 | embedTitle: string | ||
58 | |||
59 | isLive: boolean | ||
60 | liveOptions?: { | ||
61 | latencyMode: LiveVideoLatencyMode | ||
62 | } | ||
63 | |||
64 | language?: string | ||
65 | |||
66 | videoCaptions: VideoJSCaption[] | ||
67 | |||
68 | videoUUID: string | ||
69 | videoShortUUID: string | ||
70 | |||
71 | userWatching?: UserWatching | ||
72 | |||
73 | serverUrl: string | ||
74 | |||
75 | errorNotifier: (message: string) => void | ||
76 | } | ||
77 | |||
78 | export type PeertubePlayerManagerOptions = { | ||
79 | common: CommonOptions | ||
80 | webtorrent: WebtorrentOptions | ||
81 | p2pMediaLoader?: P2PMediaLoaderOptions | ||
82 | |||
83 | pluginsManager: PluginsManager | ||
84 | } | ||