Add tracks to video view
This commit is contained in:
@@ -11,6 +11,9 @@
|
||||
<video width="{{ width }}" height="{{ height }}" {% if poster %}poster="{{ poster }}" {% endif %}controls="controls">
|
||||
{% for source in sources %}
|
||||
<source src="{{ source.src }}" type='{{ source.type|safe }}' />
|
||||
{% endfor %}
|
||||
{% for track in tracks %}
|
||||
<track{% if track.default %} default="default"{% endif %} src="{{ track.upload.file.url }}" srclang="{{ track.lang }}" kind="{{ track.kind }}" label="{{ track.label or track.lang }}" />
|
||||
{% endfor %}
|
||||
You need a browser that understands HTML5 video and supports {% for i in used_codecs %}{{ i }}{% if not loop.last %} or {% endif %}{% endfor %} codecs.
|
||||
</video><br />
|
||||
|
||||
@@ -51,6 +51,8 @@ def video(request: HttpRequest, slug: str) -> HttpResponse:
|
||||
|
||||
template_data['qualities'] = qualities.keys()
|
||||
|
||||
template_data['tracks'] = video.tracks.all()
|
||||
|
||||
return render(request, 'video.html.j2', template_data, using='jinja2')
|
||||
|
||||
def index(request: HttpRequest) -> HttpResponse:
|
||||
|
||||
Reference in New Issue
Block a user