From c230b57dca91e5660158580bebfce03b96f443c0 Mon Sep 17 00:00:00 2001 From: j Date: Wed, 24 Nov 2021 12:45:15 +0100 Subject: [PATCH] use streaming proxy --- app/static/js/ascroll.js | 10 +++++----- app/static/js/play.js | 4 ++-- app/templates/film.html | 8 ++++---- app/templates/film_play.html | 1 + app/templates/films.html | 4 ++-- app/templates/index.html | 6 +++--- app/templates/text.html | 1 + app/text/views.py | 1 + app/video/views.py | 24 +++++++++++++++--------- 9 files changed, 34 insertions(+), 25 deletions(-) diff --git a/app/static/js/ascroll.js b/app/static/js/ascroll.js index 85dc4a1..3377f6a 100755 --- a/app/static/js/ascroll.js +++ b/app/static/js/ascroll.js @@ -211,13 +211,13 @@ function renderAnnotation(config, video, ascroll, clip) { } var values = [] clip.annotations.forEach(a => { - values.push(a.value.replace(/src="\//g, `src="${pandoraURL}/`).replace(/href="\//g, `href="${pandoraURL}/`)) + values.push(a.value.replace(/src="\//g, `src="${streamPrefix}/`).replace(/href="\//g, `href="${pandoraURL}/`)) }) values = values.join('

') div.innerHTML = `
- + ${figcaption}
@@ -228,7 +228,7 @@ function renderAnnotation(config, video, ascroll, clip) { document.addEventListener('scroll', onVisibilityChange(div.querySelector('.frame'), function(visible) { var src if (config.edit) { - src = `${pandoraURL}/${annotation.id.split('/')[0]}/480p.webm` + src = `${streamPrefix}/${annotation.id.split('/')[0]}/480p.webm` } if (config.loaded && visible) { updatePlayer(video, frame, annotation['in'], annotation['out'], src) @@ -248,7 +248,7 @@ function renderAnnotations(config) { video.WebKitPlaysInline = true video.muted = true if (config.item) { - setVideoSrc(video, `${pandoraURL}/${config.item}/480p.webm`) + setVideoSrc(video, `${streamPrefix}/${config.item}/480p.webm`) } video.addEventListener('timeupdate', timeupdate) video.addEventListener('touchstart', showOverlay) @@ -268,7 +268,7 @@ function renderAnnotations(config) { if (frame) { var src if (config.edit) { - src = `${pandoraURL}/${config.first.id.split('/')[0]}/480p.webm` + src = `${streamPrefix}/${config.first.id.split('/')[0]}/480p.webm` } updatePlayer(video, frame, config.first['in'], config.first['out'], src) } diff --git a/app/static/js/play.js b/app/static/js/play.js index 16a119c..ebdc44d 100644 --- a/app/static/js/play.js +++ b/app/static/js/play.js @@ -200,8 +200,8 @@ function renderPlayer(config) { video.muted = false video.controls = true if (config.item) { - setVideoSrc(video, `${pandoraURL}/${config.item}/480p.webm`) - video.poster = `${pandoraURL}/${config.item}/480p.jpg` + setVideoSrc(video, `${streamPrefix}/${config.item}/480p.webm`) + video.poster = `${streamPrefix}/${config.item}/480p.jpg` } video.addEventListener('timeupdate', timeupdate) var box = document.createElement('div') diff --git a/app/templates/film.html b/app/templates/film.html index 23a3232..b29f97a 100644 --- a/app/templates/film.html +++ b/app/templates/film.html @@ -59,11 +59,11 @@ body {
- +
- +
{{ item.title | safe }} {% if item.date %}({{item.date | safe }}){% endif %} diff --git a/app/templates/film_play.html b/app/templates/film_play.html index 28c8e1a..7e810cf 100644 --- a/app/templates/film_play.html +++ b/app/templates/film_play.html @@ -6,6 +6,7 @@ diff --git a/app/templates/films.html b/app/templates/films.html index d37bcc3..ee5267b 100644 --- a/app/templates/films.html +++ b/app/templates/films.html @@ -30,11 +30,11 @@
{% for item in film.data.items %} - + {% endfor %}
- +
{{ film.data.title | safe }} diff --git a/app/templates/index.html b/app/templates/index.html index 6591da6..d80c05a 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -22,11 +22,11 @@
{% if featured %}
- +