forked from 0x2620/pandora
before passing subtitles to player, strip newlines, and replace <br>s with newlines
This commit is contained in:
parent
2f914f16d6
commit
215168b8f5
1 changed files with 6 additions and 1 deletions
|
@ -798,7 +798,12 @@ pandora.getVideoOptions = function(data) {
|
||||||
options = {},
|
options = {},
|
||||||
subtitlesLayer = Ox.getObject(pandora.site.layers, 'isSubtitles', true);
|
subtitlesLayer = Ox.getObject(pandora.site.layers, 'isSubtitles', true);
|
||||||
options.subtitles = subtitlesLayer ? data.layers[subtitlesLayer.id].map(function(subtitle) {
|
options.subtitles = subtitlesLayer ? data.layers[subtitlesLayer.id].map(function(subtitle) {
|
||||||
return {id: subtitle.id, 'in': subtitle['in'], out: subtitle.out, text: subtitle.value};
|
return {
|
||||||
|
id: subtitle.id,
|
||||||
|
'in': subtitle['in'],
|
||||||
|
out: subtitle.out,
|
||||||
|
text: subtitle.value.replace(/\n/g, ' ').replace(/<br\/?>/g, '\n')
|
||||||
|
};
|
||||||
}) : [];
|
}) : [];
|
||||||
options.censored = canPlayVideo ? []
|
options.censored = canPlayVideo ? []
|
||||||
: canPlayClips ? (
|
: canPlayClips ? (
|
||||||
|
|
Loading…
Reference in a new issue