Add tracks to video view

This commit is contained in:
2022-04-05 09:06:31 +02:00
parent 8e376319b0
commit aaea5f4674
2 changed files with 5 additions and 0 deletions

View File

@@ -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 />

View File

@@ -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: