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

@@ -65,7 +65,7 @@
"normalize-css": "^2.1.0", "normalize-css": "^2.1.0",
"npm": "^6.0.0", "npm": "^6.0.0",
"npm-modernizr": "^2.8.3", "npm-modernizr": "^2.8.3",
"phraseanet-production-client": "0.34.99-d", "phraseanet-production-client": "0.34.102-d",
"requirejs": "^2.3.5", "requirejs": "^2.3.5",
"tinymce": "^4.0.28", "tinymce": "^4.0.28",
"underscore": "^1.8.3", "underscore": "^1.8.3",

View File

@@ -59,7 +59,8 @@
{% 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_height = thumbnail.get_height() > 0 ? thumbnail.get_height() : 120 %}
{% set thumbnail_width = thumbnail.get_width() > 0 ? thumbnail.get_width() : 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%" <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 class="video-iframe"></iframe> frameborder="0" allowfullscreen class="video-iframe"></iframe>

View File

@@ -93,21 +93,4 @@
</div> </div>
</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 %} {% endblock %}

View File

@@ -7577,10 +7577,10 @@ phraseanet-common@^0.4.5-d:
js-cookie "^2.1.0" js-cookie "^2.1.0"
pym.js "^1.3.1" pym.js "^1.3.1"
phraseanet-production-client@0.34.99-d: phraseanet-production-client@0.34.102-d:
version "0.34.99-d" version "0.34.102-d"
resolved "https://registry.yarnpkg.com/phraseanet-production-client/-/phraseanet-production-client-0.34.99-d.tgz#fc06941163f698dc77ebca8a4c16663aa3ac458a" resolved "https://registry.yarnpkg.com/phraseanet-production-client/-/phraseanet-production-client-0.34.102-d.tgz#ee2772fd712a5fb2acc87eae5c7d4a2a46f5a28a"
integrity sha512-016LZam+eNQqAYyduiGinT79YkGeUDWZ9uk7r01BHmgsYjWc+UoCvUvExhCCHcoyMm+qd29VfHhQAWoyCCkG6g== integrity sha512-3KtY3n9uI42o6mDUDDXX6KgP3Os2FlQE3nkzEJc3eVbstG9V6rNlk8J/ujXaMKy1hibBT+9f7TTSYy0Z9ARPBA==
dependencies: dependencies:
"@mapbox/mapbox-gl-language" "^0.9.2" "@mapbox/mapbox-gl-language" "^0.9.2"
"@turf/turf" "^5.1.6" "@turf/turf" "^5.1.6"