1 import { PluginsManager } from '@root-helpers/plugins-manager'
2 import { LiveVideoLatencyMode, VideoFile } from '@shared/models'
3 import { PlaylistPluginOptions, VideoJSCaption } from './peertube-videojs-typings'
5 export type PlayerMode = 'webtorrent' | 'p2p-media-loader'
7 export type WebtorrentOptions = {
8 videoFiles: VideoFile[]
11 export type P2PMediaLoaderOptions = {
13 segmentsSha256Url: string
14 trackerAnnounce: string[]
15 redundancyBaseUrls: string[]
16 videoFiles: VideoFile[]
19 export interface CustomizationOptions {
20 startTime: number | string
21 stopTime: number | string
34 export interface CommonOptions extends CustomizationOptions {
35 playerElement: HTMLVideoElement
36 onPlayerElementChange: (element: HTMLVideoElement) => void
39 forceAutoplay: boolean
43 nextVideo?: () => void
44 hasNextVideo?: () => boolean
46 previousVideo?: () => void
47 hasPreviousVideo?: () => boolean
49 playlist?: PlaylistPluginOptions
52 enableHotkeys: boolean
53 inactivityTimeout: number
58 theaterButton: boolean
62 authorizationHeader?: () => string
71 latencyMode: LiveVideoLatencyMode
76 videoCaptions: VideoJSCaption[]
79 videoShortUUID: string
83 videoFileToken: () => string
85 errorNotifier: (message: string) => void
88 export type PeertubePlayerManagerOptions = {
90 webtorrent: WebtorrentOptions
91 p2pMediaLoader?: P2PMediaLoaderOptions
93 pluginsManager: PluginsManager