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() { function getVideos() {
var videos = {}; var videos = [];
pandora.site.video.resolutions.forEach(function(resolution) { edit.clips.filter(function(clip) {
videos[resolution] = Ox.flatten(edit.clips.filter(function(clip) {
return clip.duration; return clip.duration;
}).map(function(clip) { }).map(function(clip) {
return pandora.getClipVideos(clip, resolution); pandora.site.video.resolutions.forEach(function(resolution) {
})); videos = videos.concat(pandora.getClipVideos(clip, resolution));
});
}); });
return videos; return videos;
} }

View file

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