Merge branch 'master' into PHRAS-2671_change_behaviour_of_display_audio

This commit is contained in:
Nicolas Maillat
2019-08-01 22:13:51 +02:00
committed by GitHub
3 changed files with 24 additions and 11 deletions

View File

@@ -45,23 +45,36 @@
{% set dataH = constant('media_subdef::TC_DATA_HEIGHT') %}
{% set technical_info = record.get_technical_infos %}
{#Set the preview Ratio #}
{% set width = technical_info[dataW].value %}
{% set height = technical_info[dataH].value %}
{% set prevRatio = '' %}
{% if width and height %}
{% set rawRatio = (width / height)|number_format(3, '.') %}
{% set rawRatioLength = rawRatio|length %}
{% set ratio = rawRatio|slice(0,rawRatioLength-1) %}
{% else %}
{% set ratio = '' %}
{% set ratio = (width / height)|number_format(2, '.') %}
{% endif %}
<video id="thumb_video" controls="" preload="auto" data-ratio="{{ ratio }}">
{#Set the document Ratio #}
{% for subdef in previewHtml5 %}
{% set width = subdef.get_width() %}
{% set height = subdef.get_height() %}
{% if width and height %}
{% if subdef.get_name()=='preview' %}
{% set prevRatio = (width / height)|number_format(2, '.') %}
{% endif %}
{% endif %}
{% endfor %}
<video id="thumb_video" controls="" preload="auto" data-ratio="{{ prevRatio }}">
{% for subdef in previewHtml5 %}
<source type="{{ subdef.get_mime() }}" src="{{ subdef.get_url() }}"/>
{% endfor %}
{{ 'No preview available' | trans }}
</video>
</div>
<div id="thumb_camera_button"></div>
@@ -109,7 +122,7 @@
<canvas data-width="{{ subdef.get_width() }}"
data-height="{{ subdef.get_height() }}"
data-name="{{ subdef.get_name() }}"
class="alt_canvas" id="{{ subdef.get_name() }}"></canvas>
class="alt_canvas" id="{{ subdef.get_name() }}" ></canvas>
{% endfor %}
</div>