fix getting subtitlesLayer

This commit is contained in:
rolux 2013-10-22 17:42:35 +00:00
parent 024c5ca16d
commit 82fa80a4f9

View file

@ -1618,15 +1618,19 @@ pandora.getVideoOptions = function(data) {
options = {}; options = {};
options.subtitlesLayer = pandora.site.layers.filter(function(layer) { options.subtitlesLayer = pandora.site.layers.filter(function(layer) {
return layer.isSubtitles; return layer.isSubtitles;
}).map(function(layer) {
return layer.id;
})[0]; })[0];
options.subtitles = options.subtitlesLayer ? data.layers[options.subtitlesLayer.id].map(function(subtitle) { options.subtitles = options.subtitlesLayer
? data.layers[options.subtitlesLayer].map(function(subtitle) {
return { return {
id: subtitle.id, id: subtitle.id,
'in': subtitle['in'], 'in': subtitle['in'],
out: subtitle.out, out: subtitle.out,
text: subtitle.value.replace(/\n/g, ' ').replace(/<br\/?>/g, '\n') text: subtitle.value.replace(/\n/g, ' ').replace(/<br\/?>/g, '\n')
}; };
}) : []; })
: [];
options.censored = canPlayVideo ? [] options.censored = canPlayVideo ? []
: canPlayClips ? ( : canPlayClips ? (
options.subtitles.length options.subtitles.length