From: ScottDowne Date: Wed, 18 May 2011 00:13:00 +0000 (-0400) Subject: [#421] apply css property in options X-Git-Tag: v0.6~10^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=832f745edb48f3d28c61676c54a508cda93c188a;p=popcorn-js.git [#421] apply css property in options --- diff --git a/players/vimeo/popcorn.vimeo.html b/players/vimeo/popcorn.vimeo.html index 781fe7d..6c0bea8 100644 --- a/players/vimeo/popcorn.vimeo.html +++ b/players/vimeo/popcorn.vimeo.html @@ -102,8 +102,10 @@ //On document ready document.addEventListener( "DOMContentLoaded", function() { var player = Popcorn( Popcorn.vimeo( "player_1", "http://player.vimeo.com/video/11127501", { - width: 500, - height: 281 + css: { + width: "500px", + height: "281px" + } }) ) .footnote({ start: 5, // seconds diff --git a/players/vimeo/popcorn.vimeo.js b/players/vimeo/popcorn.vimeo.js index 0007c8c..2bc2e19 100644 --- a/players/vimeo/popcorn.vimeo.js +++ b/players/vimeo/popcorn.vimeo.js @@ -282,6 +282,8 @@ this._target.appendChild( this._container ); options = options || {}; + + options.css && Popcorn.extend( this._target.style, options.css ); this.addEventFn; this.evtHolder; @@ -300,8 +302,8 @@ this.evtHolder = new EventManager( this ); // For calculating position relative to video (like subtitles) - this.width = options.width || this._target.style.width || "504px"; - this.height = options.height || this._target.style.height || "340px"; + this.width = this._target.style.width || "504px"; + this.height = this._target.style.height || "340px"; if ( !/[\d]%/.test( this.width ) ) { this.offsetWidth = parseInt( this.width, 10 );