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
33 playbackRate?: number | string
36 export interface CommonOptions extends CustomizationOptions {
37 playerElement: HTMLVideoElement
38 onPlayerElementChange: (element: HTMLVideoElement) => void
41 forceAutoplay: boolean
45 nextVideo?: () => void
46 hasNextVideo?: () => boolean
48 previousVideo?: () => void
49 hasPreviousVideo?: () => boolean
51 playlist?: PlaylistPluginOptions
54 enableHotkeys: boolean
55 inactivityTimeout: number
58 videoViewIntervalMs: number
62 theaterButton: boolean
66 authorizationHeader?: () => string
75 latencyMode: LiveVideoLatencyMode
80 videoCaptions: VideoJSCaption[]
83 videoShortUUID: string
87 videoFileToken: () => string
89 errorNotifier: (message: string) => void
92 export type PeertubePlayerManagerOptions = {
94 webtorrent: WebtorrentOptions
95 p2pMediaLoader?: P2PMediaLoaderOptions
97 pluginsManager: PluginsManager