Skip to content

Commit

Permalink
Improved max-width test for MediaElementPlayer.setPlayerSize
Browse files Browse the repository at this point in the history
The test for max-width in MediaElementPlayer.setPlayerSize only returns true if max-width is set to 100%. Firefox returns the calculated value instead, so this check always fails in FF. A different, solution is to simply check if a max-width is set and if that value is different than the width of the video, in which case it should probably be resized. This should resolve mediaelement#920.
  • Loading branch information
joemcgill committed Jul 4, 2015
1 parent 0a97cd9 commit 4cdfb89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/mep-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@
}

// detect 100% mode - use currentStyle for IE since css() doesn't return percentages
if (t.height.toString().indexOf('%') > 0 || t.$node.css('max-width') === '100%' || (t.$node[0].currentStyle && t.$node[0].currentStyle.maxWidth === '100%')) {
if (t.height.toString().indexOf('%') > 0 || (t.$node.css('max-width') !== 'none' && t.$node.css('max-width') !== 't.width') || (t.$node[0].currentStyle && t.$node[0].currentStyle.maxWidth === '100%')) {

// do we have the native dimensions yet?
var nativeWidth = (function() {
Expand Down

0 comments on commit 4cdfb89

Please sign in to comment.