videoViewUrl: string
embedUrl: string
+ isLive: boolean
+
language?: string
videoCaptions: VideoJSCaption[]
private static alreadyPlayed = false
+ static initState () {
+ PeertubePlayerManager.alreadyPlayed = false
+ }
+
static async initialize (mode: PlayerMode, options: PeertubePlayerManagerOptions, onPlayerChange: (player: videojs.Player) => void) {
let p2pMediaLoader: any
const p2pMediaLoaderConfig = {
loader: {
trackerAnnounce,
- segmentValidator: segmentValidatorFactory(options.p2pMediaLoader.segmentsSha256Url),
+ segmentValidator: segmentValidatorFactory(options.p2pMediaLoader.segmentsSha256Url, options.common.isLive),
rtcConfig: getRtcConfig(),
- requiredSegmentsPriority: 5,
+ requiredSegmentsPriority: 1,
segmentUrlBuilder: segmentUrlBuilderFactory(redundancyUrlManager),
useP2P: getStoredP2PEnabled(),
consumeOnly
const resolution = Math.min(level.height || 0, level.width || 0)
const file = p2pMediaLoaderOptions.videoFiles.find(f => f.resolution.id === resolution)
- if (!file) {
- console.error('Cannot find video file for level %d.', level.height)
- return level.height
- }
+ // We don't have files for live videos
+ if (!file) return level.height
let label = file.resolution.label
if (file.fps >= 50) label += file.fps
hlsjsConfig: {
capLevelToPlayerSize: true,
autoStartLoad: false,
- liveSyncDurationCount: 7,
+ liveSyncDurationCount: 5,
loader: new p2pMediaLoaderModule.Engine(p2pMediaLoaderConfig).createLoaderClass()
}
}