add pandora.site.video.previewRatio

This commit is contained in:
rolux 2012-01-30 21:16:58 +00:00
parent 8c5bbfd716
commit 15534396a2
4 changed files with 5 additions and 3 deletions

View file

@ -700,6 +700,7 @@
"video": { "video": {
"download": false, "download": false,
"formats": ["webm", "mp4"], "formats": ["webm", "mp4"],
"previewRatio": 1.7777777778,
"resolutions": [96] "resolutions": [96]
} }
} }

View file

@ -602,6 +602,7 @@
"video": { "video": {
"download": true, "download": true,
"formats": ["webm", "mp4"], "formats": ["webm", "mp4"],
"previewRatio": 1.3333333333,
"resolutions": [480, 240, 96] "resolutions": [480, 240, 96]
} }
} }

View file

@ -555,7 +555,7 @@ pandora.getInfoHeight = function(includeHidden) {
); );
height = Math.min( height = Math.min(
isVideoPreview isVideoPreview
? Math.round(pandora.user.ui.sidebarSize / (16/9)) + 16 ? Math.round(pandora.user.ui.sidebarSize / pandora.site.video.previewRatio) + 16
: pandora.user.ui.sidebarSize, : pandora.user.ui.sidebarSize,
window.innerHeight - 109 // 20 menu + 24 bar + 64 (4 closed folders) + 1 resizebar window.innerHeight - 109 // 20 menu + 24 bar + 64 (4 closed folders) + 1 resizebar
); );

View file

@ -10,8 +10,8 @@ pandora.ui.videoPreview = function(data) {
return resolution >= data.height; return resolution >= data.height;
}), }),
resolution = resolutions.length resolution = resolutions.length
? Math.min(resolutions) ? Ox.min(resolutions)
: Math.max(pandora.site.video.resolutions); : Ox.max(pandora.site.video.resolutions);
return '/' + data.id + '/' + resolution + 'p' + ( return '/' + data.id + '/' + resolution + 'p' + (
Ox.isUndefined(position) ? '' : position Ox.isUndefined(position) ? '' : position
) + '.jpg'; ) + '.jpg';