Skip to content

Commit

Permalink
fixes as per review [#728]
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher De Cairos committed Oct 24, 2011
1 parent 06cb016 commit 3452997
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions players/vimeo/popcorn.vimeo.html
Expand Up @@ -56,7 +56,7 @@

// Volume
document.getElementById( "btnVolume" ).addEventListener( "click", function() {
volume = volume === 100 ? 50 : 100;
volume = volume === 1 ? 0.5 : 1;
player.volume( volume );
}, false);

Expand Down Expand Up @@ -178,7 +178,7 @@
<div>
Current Time (s): <span id="player_time"></span>
<br />Video Duration (s): <span id="player_duration"></span>
<br />Volume (0-100): <span id="player_vol"></span>
<br />Volume (0-1): <span id="player_vol"></span>
<br />Load Status: <span id="player_load">Not Started</span>
</div>
</div>
Expand Down
18 changes: 12 additions & 6 deletions players/vimeo/popcorn.vimeo.js
Expand Up @@ -20,12 +20,18 @@
seeking = false,
volumeChanged = false,
lastMuted = false,
lastVolume = 0;
lastVolume = 0,
height,
width;

vimeoContainer.id = media.id + Popcorn.guid();

media.appendChild( vimeoContainer );

// setting vimeo player's height and width, default to 560 x 315
width = media.style.width ? ""+media.offsetWidth : "560";
height = media.style.height ? ""+media.offsetHeight : "315";

var vimeoInit = function() {

var flashvars,
Expand Down Expand Up @@ -179,20 +185,20 @@
set: function( val ) {

if ( !val || typeof val !== "number" || ( val < 0 || val > 1 ) ) {
return vimeoObject.api_getVolume();
return vimeoObject.api_getVolume() / 100;
}

if ( vimeoObject.api_getVolume() !== val ) {
vimeoObject.api_setVolume( val );
vimeoObject.api_setVolume( val * 100 );
lastVolume = vimeoObject.api_getVolume();
media.dispatchEvent( "volumechange" );
}

return vimeoObject.api_getVolume();
return vimeoObject.api_getVolume() / 100;
},
get: function() {

return vimeoObject.api_getVolume();
return vimeoObject.api_getVolume() / 100;
}
});

Expand Down Expand Up @@ -238,7 +244,7 @@
};

swfobject.embedSWF( "http://vimeo.com/moogaloop.swf", vimeoContainer.id,
media.offsetWidth + "", media.offsetHeight + "", "9.0.0", "expressInstall.swf",
width, height, "9.0.0", "expressInstall.swf",
flashvars, params, attributes );

};
Expand Down

0 comments on commit 3452997

Please sign in to comment.