]> git.parisson.com Git - teleforma.git/commitdiff
add random hash to video monitor
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 23 Jan 2023 15:04:58 +0000 (16:04 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 23 Jan 2023 15:04:58 +0000 (16:04 +0100)
teleforma/templates/teleforma/course_conference.html
teleforma/templates/teleforma/course_conference_record.html
teleforma/templatetags/teleforma_tags.py

index 57a967cf741b2d602f25ccb42a967a08f4313460..20b05e37c512a6a54552197860d046856d389bcd 100644 (file)
@@ -53,7 +53,7 @@
 <div class="video">
 <video width="640" height="360" controls autoplay preload="auto">
 <!-- Hello Chrome and Firefox (and Opera?) -->
-<source src="{{ livestream.url|set_host:host }}" type="video/webm" />
+<source src="{{ livestream.url|set_host:host }}#{% get_random_hash %}" type="video/webm" />
 </video>
 </div>
 {% endif %}
index 577d46f06a6ebd34236d0af3f1cb2431350b42cc..5f9b2ab2f2ce5f9f79330406d96e9d7579da4ad5 100644 (file)
@@ -75,7 +75,7 @@ $(document).ready(function(){
 {% block video %}
 <div class="video">
 <video controls autoplay preload="auto" width="640" height="360">
-<source src="http://{{ host }}:8000/monitor.webm" type="video/webm">
+<source src="http://{{ host }}:8000/monitor.webm#{% get_random_hash %}" type="video/webm">
 </video>
 </div>
 {% endblock video %}
index 9bbfd641d74bf7197847f4a4ad6343735625de2d..9a726533dbf022c2428a406def01fc484066e606 100644 (file)
@@ -54,6 +54,8 @@ from timezones.utils import localtime_for_timezone
 from django.utils.translation import ugettext_lazy as _
 from teleforma.views import get_courses
 from urlparse import urlparse
+from teleforma.models import get_random_hash
+
 
 register = template.Library()
 
@@ -197,3 +199,7 @@ def set_host(url, host):
     u = urlparse(url)
     return u.scheme + '://' + host + ':' + str(u.port) + u.path
     
+
+@register.assignment_tag
+def get_random_hash():
+    return get_random_hash()