From cf2fd9cbe80ae61bfb4173076b2d0640a9aad876 Mon Sep 17 00:00:00 2001 From: Alex Vasilenko Date: Thu, 7 Mar 2013 23:21:08 +0200 Subject: [PATCH] use {width: "auto", height: "auto"} to let css decide video dimensions --- src/js/core.js | 3 +++ src/js/player.js | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/js/core.js b/src/js/core.js index 41109eab1..b484ec626 100644 --- a/src/js/core.js +++ b/src/js/core.js @@ -72,6 +72,9 @@ vjs.options = { 'html5': {}, 'flash': { swf: vjs.ACCESS_PROTOCOL + 'vjs.zencdn.net/c/video-js.swf' }, + // Default of web browser is 300x150. Should rely on source width/height. + 'width': 300, + 'height': 150, // defaultVolume: 0.85, 'defaultVolume': 0.00, // The freakin seaguls are driving me crazy! diff --git a/src/js/player.js b/src/js/player.js index b63d4f77b..8e16ca7c2 100644 --- a/src/js/player.js +++ b/src/js/player.js @@ -171,10 +171,10 @@ vjs.Player.prototype.createEl = function(){ // Make box use width/height of tag, or rely on default implementation // Enforce with CSS since width/height attrs don't work on divs - if (this.options_['width']) { + if (this.options_['width'] !== 'auto') { this.width(this.options_['width'], true); // (true) Skip resize listener on load } - if (this.options_['height']) { + if (this.options_['height'] !== 'auto') { this.height(this.options_['height'], true); }