Compat peertube v6

This commit is contained in:
Chocobozzz 2023-12-13 08:36:59 +01:00
parent c91738bd38
commit 3fbd095af3
No known key found for this signature in database
GPG Key ID: 583A612D890159BE

View File

@ -6,12 +6,18 @@ export function buildPlayer (video, player, videojs) {
const fieldName = 'player-annotations'
if (!video.pluginData || !video.pluginData[fieldName]) return
if (!video.pluginData || !video.pluginData[fieldName]) {
player.overlay({ overlays: [] })
return
}
const annotationsText = video.pluginData[fieldName]
const annotations = parseAnnotations(video, annotationsText)
if (!annotations) return
if (!annotations) {
player.overlay({ overlays: [] })
return
}
console.log('Will inject annotations in player.', annotations)