de-refactoring
This commit is contained in:
parent
cbcfbe8340
commit
fc982fe775
1 changed files with 8 additions and 11 deletions
|
@ -1731,16 +1731,6 @@ Ox.VideoPlayer = function(options, self) {
|
|||
|
||||
function getVideoCSS(videoWidth, videoHeight) {
|
||||
// optional arguments allow for this function to be used for poster CSS
|
||||
var dimensions = getVideoDimensions(videoWidth, videoHeight);
|
||||
return {
|
||||
left: Math.floor((self.width - dimensions[0]) / 2),
|
||||
top: Math.floor((self.height - dimensions[1]) / 2),
|
||||
width: dimensions[0],
|
||||
height: dimensions[1]
|
||||
};
|
||||
}
|
||||
|
||||
function getVideoDimensions(videoWidth, videoHeight) {
|
||||
var playerWidth = self.width,
|
||||
playerHeight = self.height,
|
||||
playerRatio = playerWidth / playerHeight,
|
||||
|
@ -1756,7 +1746,14 @@ Ox.VideoPlayer = function(options, self) {
|
|||
width = videoIsWider ? playerWidth : playerHeight * videoRatio;
|
||||
height = videoIsWider ? playerWidth / videoRatio : playerHeight;
|
||||
}
|
||||
return [Math.round(width), Math.round(height)];
|
||||
width = Math.round(width);
|
||||
height = Math.round(height);
|
||||
return {
|
||||
left: Math.floor((self.width - width) / 2),
|
||||
top: Math.floor((self.height - width) / 2),
|
||||
width: width,
|
||||
height: height
|
||||
};
|
||||
}
|
||||
|
||||
function getVolumeImage() {
|
||||
|
|
Loading…
Reference in a new issue