<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 }}#{% random_hash %}" type="video/webm" />
+<source src="{{ livestream.url|set_host:host }}?v={% random_hash %}" type="video/webm" />
</video>
</div>
{% endif %}
@register.tag
def random_hash(parser, token):
- return get_random_hash()
+ return RandomHash()
+
+class RandomHash(template.Node):
+ def render(self, context):
+ return get_random_hash()