Merge pull request #86 from k88hudson/t1120

[t1120] Fixes for youtube sizing
This commit is contained in:
ScottDowne 2012-06-06 14:11:50 -07:00
Родитель 17457d00be 7bcfc2922c
Коммит 667cb29b9c
1 изменённых файлов: 9 добавлений и 3 удалений

Просмотреть файл

@ -168,7 +168,7 @@ Popcorn.player( "youtube", {
var youtubeInit = function() {
var src, height, width, query;
var src, width, height, originalStyle, query;
var timeUpdate = function() {
@ -219,10 +219,16 @@ Popcorn.player( "youtube", {
autoPlay = ( /autoplay=1/.test( query ) );
// cache original display property so it can be reapplied
originalStyle = media.style.display;
media.style.display = "inline";
// setting youtube player's height and width, min 640 x 390,
// anything smaller, and the player reports incorrect states.
height = media.style.height && media.offsetHeight >= 390 ? "" + media.offsetHeight : "390";
width = media.style.width && media.offsetWidth >= 640 ? "" + media.offsetWidth : "640";
height = media.clientHeight >= 390 ? "" + media.clientHeight : "390";
width = media.clientWidth >= 640 ? "" + media.clientWidth : "640";
media.style.display = originalStyle;
options.youtubeObject = new YT.Player( container.id, {
height: height,