From fdfb33d39de52891eac8592c84da501622cd0d7b Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 15 Jul 2015 16:38:42 +0000 Subject: [PATCH] Fix video size on chrome android --- js/libs/fluidbook/fluidbook.js | 12 ++++++--- js/libs/fluidbook/fluidbook.resize.js | 16 +++++++++--- video/brightcove.html | 37 ++++++++++++++++++++++++--- 3 files changed, 54 insertions(+), 11 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.js b/js/libs/fluidbook/fluidbook.js index 35dea0e7..159eec89 100644 --- a/js/libs/fluidbook/fluidbook.js +++ b/js/libs/fluidbook/fluidbook.js @@ -934,17 +934,21 @@ Fluidbook.prototype = { var view = '
' + this.l10n.__('back') + '
'; view += '
'; + + var h = this.resize.getPopupWebVideoHeight(); + if (service == 'youtube') { - view += ''; + view += ''; } else if (service == 'dailymotion') { - view += '' + view += '' } else if (service == 'brightcove') { - view += '' + view += '' } view += '
'; $("#view").append('
' + view + '
'); $("#view .mview:last iframe").each(function () { - $(this).attr('height', ($(this).width() * 9) / 16); + $(this).attr('height', h); + $(this).css('height', h); }); this.stats.track(11); if (callback != undefined) { diff --git a/js/libs/fluidbook/fluidbook.resize.js b/js/libs/fluidbook/fluidbook.resize.js index 210a8ba4..4c9126ca 100644 --- a/js/libs/fluidbook/fluidbook.resize.js +++ b/js/libs/fluidbook/fluidbook.resize.js @@ -183,8 +183,19 @@ FluidbookResize.prototype = { }); $("#next,#previous").show(); }, + + getPopupVideoHeight: function () { + this.updateWindow(); + return this.hh - 80; + }, + + getPopupWebVideoHeight: function () { + return $(window).height() - 44; + }, + resizePopupVideos: function () { - var maxh = this.hh - 80; + var $this = this; + var maxh = this.getPopupVideoHeight(); var maxw = $(window).width() - 40; var w; var h; @@ -215,8 +226,7 @@ FluidbookResize.prototype = { $(".mview .webvideo").each(function () { - var h = $(window).height() - 44; - $(this).css('height', h); + $(this).css('height', $this.getPopupWebVideoHeight()); }); $(".mview .multimediaScale").each(function () { diff --git a/video/brightcove.html b/video/brightcove.html index 09494b77..7565ca12 100644 --- a/video/brightcove.html +++ b/video/brightcove.html @@ -5,6 +5,7 @@