use getVideoUrl in embed code too

This commit is contained in:
j 2012-03-03 19:58:07 +01:00
parent 8120fbe3ee
commit c8da81ceb6

View file

@ -82,6 +82,14 @@ Ox.load('UI', {
} }
} }
}); });
function getVideoUrl(id, resolution, part) {
var prefix = pandora.site.site.videoprefix
.replace('{id}', id)
.replace('{part}', part)
.replace('{resolution}', resolution)
.replace('{uid}', Ox.uid());
return prefix + '/' + id + '/' + resolution + 'p' + part + '.' + pandora.user.videoFormat;
}
function getVideoOptions(data) { function getVideoOptions(data) {
var canPlayClips = data.editable || pandora.site.capabilities.canPlayClips[pandora.user.level] >= data.rightslevel, var canPlayClips = data.editable || pandora.site.capabilities.canPlayClips[pandora.user.level] >= data.rightslevel,
@ -115,10 +123,7 @@ Ox.load('UI', {
options.video = {}; options.video = {};
pandora.site.video.resolutions.forEach(function(resolution) { pandora.site.video.resolutions.forEach(function(resolution) {
options.video[resolution] = Ox.range(data.parts).map(function(i) { options.video[resolution] = Ox.range(data.parts).map(function(i) {
var part = (i + 1), return getVideoUrl(data.item || pandora.user.ui.item, resolution, i + 1);
prefix = pandora.site.site.videoprefix.replace('{part}', part);
return prefix + '/' + (data.item || pandora.user.ui.item) + '/'
+ resolution + 'p' + part + '.' + pandora.user.videoFormat;
}); });
}); });
options.layers = []; options.layers = [];