<div class="video">
<video width="640" height="360" controls autoplay preload="auto">
<!-- Hello Chrome and Firefox (and Opera?) -->
-<source src="{{ livestream.url }}" type="video/webm" />
+<source src="{{ livestream.url|get_host:host }}" type="video/webm" />
</video>
</div>
<div class="audio">
<audio controls autoplay preload="auto">
<!-- Hello Chrome and Firefox (and Opera?) -->
-<source src="{{ livestream.url }}" type="audio/mpeg" />
+<source src="{{ livestream.url|get_host:host }}" type="audio/mpeg" />
</audio>
</div>
{% endif %}
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
register = template.Library()
if m.type == "webm":
break
return m.id
+
+@register.filter
+def get_host(url, host):
+ u = urlparse(url)
+ if host == '127.0.0.1' or host == 'localhost':
+ u['netloc'] = host
+ return u.geturl()
+ else:
+ return url
context['room'] = get_room(name=conference.course.title, content_type=content_type,
id=conference.id)
context['livestreams'] = conference.livestream.all()
+ context['host'] = get_host(self.request)
return context
@jsonrpc_method('teleforma.conference_stop')