2011-08-08 13:58:28 +00:00
|
|
|
// vim: et:ts=4:sw=4:sts=4:ft=javascript
|
|
|
|
|
2011-11-05 17:04:10 +00:00
|
|
|
'use strict';
|
|
|
|
|
2011-08-08 13:58:28 +00:00
|
|
|
pandora.ui.videoPreview = function(data) {
|
2011-09-18 06:51:28 +00:00
|
|
|
var that = Ox.VideoPreview({
|
2011-08-19 14:43:05 +00:00
|
|
|
duration: data.duration,
|
2011-08-08 13:58:28 +00:00
|
|
|
getFrame: function(position) {
|
2012-05-22 15:07:34 +00:00
|
|
|
var resolutions = pandora.site.video.resolutions.filter(function(resolution, i) {
|
2012-01-30 20:48:04 +00:00
|
|
|
return resolution >= data.height;
|
|
|
|
}),
|
|
|
|
resolution = resolutions.length
|
2012-01-30 21:16:58 +00:00
|
|
|
? Ox.min(resolutions)
|
|
|
|
: Ox.max(pandora.site.video.resolutions);
|
2014-02-02 11:30:25 +00:00
|
|
|
return pandora.getMediaURL('/' + data.id + '/' + resolution + 'p' + (
|
2011-08-08 13:58:28 +00:00
|
|
|
Ox.isUndefined(position) ? '' : position
|
2015-11-10 15:08:00 +00:00
|
|
|
) + '.jpg?' + data.modified);
|
2011-08-08 13:58:28 +00:00
|
|
|
},
|
2011-09-18 06:51:28 +00:00
|
|
|
frameRatio: data.frameRatio,
|
2011-09-19 12:29:55 +00:00
|
|
|
height: data.height,
|
2011-09-29 17:25:04 +00:00
|
|
|
position: data.position,
|
2011-09-18 21:18:05 +00:00
|
|
|
scaleToFill: true,
|
2015-11-10 15:08:00 +00:00
|
|
|
timeline: pandora.getMediaURL('/' + data.id + '/timeline16p.jpg?' + data.modified),
|
2013-02-11 06:33:53 +00:00
|
|
|
videoTooltip: data.videoTooltip,
|
2011-09-19 12:29:55 +00:00
|
|
|
width: data.width
|
2011-08-08 13:58:28 +00:00
|
|
|
});
|
|
|
|
return that;
|
|
|
|
};
|
|
|
|
|