]> git.parisson.com Git - telecaster-client.git/commitdiff
add randdom hash
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 23 Jan 2023 19:44:43 +0000 (20:44 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 23 Jan 2023 19:44:43 +0000 (20:44 +0100)
telecaster/templates/telecaster/base.html
telecaster/templatetags/telecaster_utils.py

index 87f57425265fd56f344af47b1b2f7ed144c66eed..4b05f69cbbc351181e6711ea5f4c23c107e82b66 100644 (file)
@@ -78,7 +78,7 @@ jQuery(window).ready(function() {
 {% block video %}
 <div class="video">
 <video id="video_1" class="video-js vjs-default-skin" controls autoplay preload="auto" width="360" height="240" data-setup="{}">
-<source src="http://{{ host }}:8000/monitor.webm#{% get_random_hash %}" type="video/webm">
+<source src="http://{{ host }}:8000/monitor.webm?v={% random_hash %}" type="video/webm">
 </video>
 </div>
 {% endblock video %}
index 349ec40055969547ced0b57d0e23f0e9019492ff..12025f46db7e98041b2980bea0808e4d2aa597cd 100644 (file)
@@ -23,9 +23,10 @@ register = template.Library()
 def len(list):
     return len(list)
 
+@register.tag
+def random_hash(parser, token):
+    return RandomHash()
 
-@register.simple_tag(takes_context=True)
-def get_random_hash(context):
-    return get_random_hash()
-
-
+class RandomHash(template.Node):
+    def render(self, context):
+        return get_random_hash()