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