make subtitlesLayer part of object returned by getVideoOptions

This commit is contained in:
rolux 2013-10-22 17:49:20 +02:00
parent 559140ca76
commit e18ea23a75

View file

@ -1615,11 +1615,11 @@ pandora.getVideoURL = function(id, resolution, part) {
pandora.getVideoOptions = function(data) { 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 = {};
subtitlesLayer = pandora.site.layers.filter(function(layer) { options.subtitlesLayer = pandora.site.layers.filter(function(layer) {
return layer.isSubtitles; return layer.isSubtitles;
})[0]; })[0];
options.subtitles = subtitlesLayer ? data.layers[subtitlesLayer.id].map(function(subtitle) { options.subtitles = options.subtitlesLayer ? data.layers[options.subtitlesLayer.id].map(function(subtitle) {
return { return {
id: subtitle.id, id: subtitle.id,
'in': subtitle['in'], 'in': subtitle['in'],