Skip to content

Commit

Permalink
Merge pull request mediaelement#1083 from gymglish/master
Browse files Browse the repository at this point in the history
Bug fix: Make sure we calculate correctly the video player height
  • Loading branch information
johndyer committed Mar 27, 2014
2 parents ab9aa89 + 0f9e4c4 commit 8254b22
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/js/mep-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,11 @@
parentWidth = t.container.parent().closest(':visible').width(),
newHeight = t.isVideo || !t.options.autosizeProgress ? parseInt(parentWidth * nativeHeight/nativeWidth, 10) : nativeHeight;

// When we use percent, the newHeight can't be calculated so we get the container height
if(isNaN(newHeight)) {
newHeight = t.container.parent().closest(':visible').height();
}

if (t.container.parent()[0].tagName.toLowerCase() === 'body') { // && t.container.siblings().count == 0) {
parentWidth = $(window).width();
newHeight = $(window).height();
Expand Down

0 comments on commit 8254b22

Please sign in to comment.