PHRAS-2862 #comment Fix lightbox mobile : video resize #time 3h

This commit is contained in:
Harrys Ravalomanana
2020-01-14 16:56:40 +04:00
parent 998c751843
commit 937b9b4c59
2 changed files with 12 additions and 1 deletions

View File

@@ -57,9 +57,12 @@
{% set url = app.getAuthenticator().isAuthenticated() ? thumbnail.get_url() : thumbnail.get_permalink().get_url() %} {% set url = app.getAuthenticator().isAuthenticated() ? thumbnail.get_url() : thumbnail.get_permalink().get_url() %}
{% set record_type = thumbnail.get_type() %} {% set record_type = thumbnail.get_type() %}
{% if record_type == 'VIDEO_MP4' or record_type == 'VIDEO_FLV' %} {% 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 }}"/>
<iframe width="100%" height="100%" <iframe width="100%" height="100%"
src="{{ url('alchemy_embed_view', {url: url|trim, autoplay: autoplay|default('false') }) }}" src="{{ url('alchemy_embed_view', {url: url|trim, autoplay: autoplay|default('false') }) }}"
frameborder="0" allowfullscreen></iframe> frameborder="0" allowfullscreen class="video-iframe"></iframe>
{% elseif record_type == 'FLEXPAPER' %} {% elseif record_type == 'FLEXPAPER' %}
<iframe width="100%" height="100%" <iframe width="100%" height="100%"
src="{{ url('alchemy_embed_view', {url: url|trim, autoplay: autoplay|default('false') }) }}" src="{{ url('alchemy_embed_view', {url: url|trim, autoplay: autoplay|default('false') }) }}"

View File

@@ -101,5 +101,13 @@
$('.pdf-iframe').css('height', pdfHeight); $('.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> </script>
{% endblock %} {% endblock %}