From c8da81ceb668d3eeb3db0a0a1edf4cb253c8068d Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 3 Mar 2012 19:58:07 +0100 Subject: [PATCH] use getVideoUrl in embed code too --- static/js/embed/pandora.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/static/js/embed/pandora.js b/static/js/embed/pandora.js index f36eea8e..77f8e2e5 100755 --- a/static/js/embed/pandora.js +++ b/static/js/embed/pandora.js @@ -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) { var canPlayClips = data.editable || pandora.site.capabilities.canPlayClips[pandora.user.level] >= data.rightslevel, @@ -115,10 +123,7 @@ Ox.load('UI', { options.video = {}; pandora.site.video.resolutions.forEach(function(resolution) { options.video[resolution] = Ox.range(data.parts).map(function(i) { - var part = (i + 1), - prefix = pandora.site.site.videoprefix.replace('{part}', part); - return prefix + '/' + (data.item || pandora.user.ui.item) + '/' - + resolution + 'p' + part + '.' + pandora.user.videoFormat; + return getVideoUrl(data.item || pandora.user.ui.item, resolution, i + 1); }); }); options.layers = [];