refactor embed js

This commit is contained in:
rolux 2013-02-12 13:25:05 +05:30
parent 6877cd592c
commit b94681dcb0

View file

@ -164,11 +164,6 @@ Ox.load('UI', {
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,
canPlayVideo = data.editable || pandora.site.capabilities.canPlayVideo[pandora.user.level] >= data.rightslevel, canPlayVideo = data.editable || pandora.site.capabilities.canPlayVideo[pandora.user.level] >= data.rightslevel,
options = {}; options = {};
options.subtitles = data.layers.subtitles
? data.layers.subtitles.map(function(subtitle) {
return {'in': subtitle['in'], out: subtitle.out, text: subtitle.value};
})
: [];
options.censored = canPlayVideo ? [] options.censored = canPlayVideo ? []
: canPlayClips ? ( : canPlayClips ? (
options.subtitles.length options.subtitles.length
@ -205,6 +200,11 @@ Ox.load('UI', {
}); });
}); });
options.posterFrame = data.posterFrame; options.posterFrame = data.posterFrame;
options.subtitles = data.layers.subtitles
? data.layers.subtitles.map(function(subtitle) {
return {'in': subtitle['in'], out: subtitle.out, text: subtitle.value};
})
: [];
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) {