no stream prefix for now

This commit is contained in:
j 2023-03-02 16:27:25 +01:00
parent 4640b934cd
commit e89d8fd13d

View file

@ -168,13 +168,13 @@ function renderAnnotation(config, video, root, clip) {
} }
var values = [] var values = []
clip.annotations.forEach(a => { clip.annotations.forEach(a => {
values.push(a.value.replace(/src="\//g, `src="${streamPrefix}/`).replace(/href="\//g, `href="${pandoraURL}/`)) values.push(a.value.replace(/src="\//g, `src="${pandoraURL}/`).replace(/href="\//g, `href="${pandoraURL}/`))
}) })
values = values.join('<br><br>') values = values.join('<br><br>')
div.innerHTML = ` div.innerHTML = `
<div class="frame"> <div class="frame">
<figure> <figure>
<img src="${streamPrefix}/${annotation.id.split('/')[0]}/${imageResolution}p${annotation.in}.jpg"> <img src="${pandoraURL}/${annotation.id.split('/')[0]}/${imageResolution}p${annotation.in}.jpg">
${figcaption} ${figcaption}
</figure> </figure>
</div> </div>
@ -187,7 +187,7 @@ function renderAnnotation(config, video, root, clip) {
if (clip.src) { if (clip.src) {
src = clip.src src = clip.src
} else if (config.edit) { } else if (config.edit) {
src = `${streamPrefix}/${annotation.id.split('/')[0]}/480p.webm` src = `${pandoraURL}/${annotation.id.split('/')[0]}/480p.webm`
} }
if (config.loaded && visible) { if (config.loaded && visible) {
updatePlayer(video, frame, annotation['in'], annotation['out'], src, config) updatePlayer(video, frame, annotation['in'], annotation['out'], src, config)
@ -213,7 +213,7 @@ function renderAnnotations(config) {
video.WebKitPlaysInline = true video.WebKitPlaysInline = true
video.muted = true video.muted = true
if (config.item) { if (config.item) {
setVideoSrc(video, `${streamPrefix}/${config.item}/480p.webm`) setVideoSrc(video, `${pandoraURL}/${config.item}/480p.webm`)
} }
video.addEventListener('timeupdate', timeupdate) video.addEventListener('timeupdate', timeupdate)
video.addEventListener('touchstart', showOverlay) video.addEventListener('touchstart', showOverlay)
@ -233,7 +233,7 @@ function renderAnnotations(config) {
if (frame) { if (frame) {
var src var src
if (config.edit) { if (config.edit) {
src = `${streamPrefix}/${config.first.id.split('/')[0]}/480p.webm` src = `${pandoraURL}/${config.first.id.split('/')[0]}/480p.webm`
} }
updatePlayer(video, frame, config.first['in'], config.first['out'], src, config) updatePlayer(video, frame, config.first['in'], config.first['out'], src, config)
} }
@ -390,7 +390,7 @@ async function loadAnnotations(config) {
function renderSingleMode(config) { function renderSingleMode(config) {
var src var src
config.annotations.forEach(annotation => { config.annotations.forEach(annotation => {
src = annotation.src = `${streamPrefix}/${annotation.id.split('/')[0]}/480p.webm` src = annotation.src = `${pandoraURL}/${annotation.id.split('/')[0]}/480p.webm`
}) })
var div = document.createElement('div') var div = document.createElement('div')
var annotation = config.annotations[0].annotations[0] var annotation = config.annotations[0].annotations[0]
@ -400,7 +400,7 @@ function renderSingleMode(config) {
div.innerHTML = ` div.innerHTML = `
<div class="frame"> <div class="frame">
<figure> <figure>
<img src="${streamPrefix}/${annotation.id.split('/')[0]}/${imageResolution}p${annotation.in}.jpg"> <img src="${pandoraURL}/${annotation.id.split('/')[0]}/${imageResolution}p${annotation.in}.jpg">
${figcaption} ${figcaption}
</figure> </figure>
</div> </div>
@ -422,7 +422,7 @@ function renderSingleMode(config) {
config.annotations.forEach(clip => { config.annotations.forEach(clip => {
var values = [] var values = []
clip.annotations.forEach(a => { clip.annotations.forEach(a => {
values.push(a.value.replace(/src="\//g, `src="${streamPrefix}/`).replace(/href="\//g, `href="${pandoraURL}/`)) values.push(a.value.replace(/src="\//g, `src="${pandoraURL}/`).replace(/href="\//g, `href="${pandoraURL}/`))
}) })
values = values.join('<br><br>') values = values.join('<br><br>')
var annot = document.createElement('div') var annot = document.createElement('div')