fix getting subtitlesLayer
This commit is contained in:
parent
024c5ca16d
commit
82fa80a4f9
1 changed files with 12 additions and 8 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue