replace Flipbook with VideoPreview
This commit is contained in:
parent
25860c20f8
commit
4ab8bb41f6
7 changed files with 67 additions and 92 deletions
34
static/js/pandora/ui/videoPreview.js
Normal file
34
static/js/pandora/ui/videoPreview.js
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
// vim: et:ts=4:sw=4:sts=4:ft=javascript
|
||||
|
||||
pandora.ui.videoPreview = function(data) {
|
||||
var frameWidth = pandora.user.ui.sidebarSize,
|
||||
frameHeight = Math.round(frameWidth / data.video.aspectRatio),
|
||||
that = Ox.VideoPreview({
|
||||
duration: data.video.duration,
|
||||
getFrame: function(position) {
|
||||
var width = pandora.user.ui.sidebarSize,
|
||||
height = Math.round(width / pandora.user.infoRatio),
|
||||
resolution = Ox.filter(data.video.resolutions, function(resolution, i) {
|
||||
return resolution >= height || i == data.video.resolutions.length - 1;
|
||||
})[0];
|
||||
return '/' + data.id + '/' + resolution + 'p' + (
|
||||
Ox.isUndefined(position) ? '' : position
|
||||
) + '.jpg';
|
||||
},
|
||||
frameHeight: frameHeight,
|
||||
frameWidth: frameWidth,
|
||||
timeline: '/' + data.id + '/timeline16p.png',
|
||||
})
|
||||
.bindEvent({
|
||||
click: function(event) {
|
||||
pandora.URL.set(
|
||||
'/' + data.id + '/timeline/' + Ox.formatDuration(event.position, 2)
|
||||
);
|
||||
}
|
||||
});
|
||||
function getResolution() {
|
||||
return
|
||||
}
|
||||
return that;
|
||||
};
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue