From 9b52edea07c8a59ffe575d5475bc4945e63b39b4 Mon Sep 17 00:00:00 2001 From: Alex Vasilenko Date: Tue, 5 Mar 2013 18:35:55 +0200 Subject: [PATCH] do not force default 300x150 if no width/height found --- src/js/core.js | 4 ---- src/js/player.js | 10 +++++++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/js/core.js b/src/js/core.js index 88b0d5873..41109eab1 100644 --- a/src/js/core.js +++ b/src/js/core.js @@ -72,10 +72,6 @@ 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 e20c68711..b63d4f77b 100644 --- a/src/js/player.js +++ b/src/js/player.js @@ -169,10 +169,14 @@ vjs.Player.prototype.createEl = function(){ // Default state of video is paused this.addClass('vjs-paused'); - // Make box use width/height of tag, or default 300x150 + // Make box use width/height of tag, or rely on default implementation // Enforce with CSS since width/height attrs don't work on divs - this.width(this.options_['width'], true); // (true) Skip resize listener on load - this.height(this.options_['height'], true); + if (this.options_['width']) { + this.width(this.options_['width'], true); // (true) Skip resize listener on load + } + if (this.options_['height']) { + this.height(this.options_['height'], true); + } // Wrap video tag in div (el/box) container if (tag.parentNode) {