]> git.parisson.com Git - teleforma.git/commitdiff
add track condition feature/video-track
authorGuillaume Pellerin <guillaume.pellerin@parisson.com>
Mon, 8 Sep 2025 15:02:50 +0000 (17:02 +0200)
committerGuillaume Pellerin <guillaume.pellerin@parisson.com>
Mon, 8 Sep 2025 15:02:50 +0000 (17:02 +0200)
teleforma/templates/teleforma/course_media.html

index 2c1dfb13557c04b17c0c356295965e61bb28806a..716f784e6f3830ab3cca9485d6d23fb1ed4b8fe2 100644 (file)
@@ -103,7 +103,9 @@ $(document).ready(function(){
         {% if media.poster_file %}{% thumbnail media.poster_file '640' as im %}poster="{{ im.url }}"{% endthumbnail %}{% endif %}
         >
         <source src="{% url 'teleforma-media-stream' period.id media.id %}" type="{{ media.mime_type }}" />
-        <track kind="captions" src="{{ MEDIA_URL }}{{ media.track_file }}" srclang="fr" label="Français" default>
+        {% if media.track_file %}
+            <track kind="captions" src="{{ MEDIA_URL }}{{ media.track_file }}" srclang="fr" label="Français" default>
+        {% endif %}
         <p class="vjs-no-js">
           To view this video please enable JavaScript, and consider upgrading to a
           web browser that