зеркало из https://github.com/mozilla/popcorn-js.git
fixes as per review [#728]
This commit is contained in:
Родитель
06cb016b15
Коммит
3452997045
|
@ -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);
|
||||
|
||||
|
@ -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>
|
||||
|
|
|
@ -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,
|
||||
|
@ -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;
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -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 );
|
||||
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче