]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/assets/player/types/manager-options.ts
Reorganize player files
[github/Chocobozzz/PeerTube.git] / client / src / assets / player / types / manager-options.ts
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 }