forked from 0x2620/pandora
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.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
|
||||
|
|
Loading…
Reference in a new issue