PHRAS-2862 Lightbox mobile :video resize #time 4h

This commit is contained in:
Harrys Ravalomanana
2020-01-17 16:56:30 +04:00
parent ee8b0aef0a
commit bd297b486f
4 changed files with 7 additions and 23 deletions

View File

@@ -59,7 +59,8 @@
{% if record_type == 'VIDEO_MP4' or record_type == 'VIDEO_FLV' %}
{% set thumbnail_height = thumbnail.get_height() > 0 ? thumbnail.get_height() : 120 %}
{% set thumbnail_width = thumbnail.get_width() > 0 ? thumbnail.get_width() : 120 %}
<input type="hidden" class="hidden" id="videoRatio" name="videoRatio" value="{{ thumbnail_width / thumbnail_height }}"/>
<input type="hidden" class="hidden" id="videoHeight" name="videoHeight" value="{{ thumbnail_height }}"/>
<input type="hidden" class="hidden" id="videoWidth" name="videoWidth" value="{{ thumbnail_width }}"/>
<iframe width="100%" height="100%"
src="{{ url('alchemy_embed_view', {url: url|trim, autoplay: autoplay|default('false') }) }}"
frameborder="0" allowfullscreen class="video-iframe"></iframe>

View File

@@ -93,21 +93,4 @@
</div>
</div>
<script type="text/javascript">
/*resize of PDF */
$(window).on("load resize ",function(e){
if($('.pdf-iframe').length > 0) {
var pdfHeight = $('.pdf-iframe').width() / 0.707;
$('.pdf-iframe').css('height', pdfHeight);
}
});
/*resize of VIDEO */
$(window).on("load resize ",function(e){
if($('.video-iframe').length > 0) {
var ratio = $('[name=videoRatio]').val();
var videoHeight = $('.video-iframe').width() / ratio;
$('.video-iframe').css('height', videoHeight).css('min-height',0);
}
});
</script>
{% endblock %}