subtitles in edits

This commit is contained in:
j 2014-09-13 23:59:23 +02:00
parent 6949cab8c6
commit 09f30b3c5a
2 changed files with 16 additions and 12 deletions

View file

@ -58,13 +58,13 @@ pandora.ui.editPanel = function(isEmbed) {
}
function getVideos() {
var videos = {};
pandora.site.video.resolutions.forEach(function(resolution) {
videos[resolution] = Ox.flatten(edit.clips.filter(function(clip) {
return clip.duration;
}).map(function(clip) {
return pandora.getClipVideos(clip, resolution);
}));
var videos = [];
edit.clips.filter(function(clip) {
return clip.duration;
}).map(function(clip) {
pandora.site.video.resolutions.forEach(function(resolution) {
videos = videos.concat(pandora.getClipVideos(clip, resolution));
});
});
return videos;
}

View file

@ -1734,6 +1734,14 @@ pandora.getStatusText = function(data) {
return parts.join(', ');
};
pandora.getSubtitlesLayer = function() {
return pandora.site.layers.filter(function(layer) {
return layer.isSubtitles;
}).map(function(layer) {
return layer.id;
})[0];
}
pandora.getMediaURL = function(url) {
return pandora.site.site.mediaprefix + url;
};
@ -1753,11 +1761,7 @@ pandora.getVideoOptions = function(data) {
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,
options = {};
options.subtitlesLayer = pandora.site.layers.filter(function(layer) {
return layer.isSubtitles;
}).map(function(layer) {
return layer.id;
})[0];
options.subtitlesLayer = pandora.getSubtitlesLayer();
options.censored = canPlayVideo ? []
: canPlayClips ? (