embedTimeline: fix subtitles (fixes #2823)
This commit is contained in:
parent
3da3bd37fd
commit
5418613023
4 changed files with 17 additions and 31 deletions
|
|
@ -1906,6 +1906,20 @@ pandora.getStatusText = function(data) {
|
|||
return parts.join(', ');
|
||||
};
|
||||
|
||||
pandora.getSubtitles = function(video) {
|
||||
return video.subtitlesLayer ? video.annotations.filter(function(layer) {
|
||||
return layer.id == video.subtitlesLayer;
|
||||
})[0].items.map(function(subtitle) {
|
||||
return {
|
||||
id: subtitle.id,
|
||||
'in': subtitle['in'],
|
||||
out: subtitle.out,
|
||||
text: subtitle.value.replace(/\n/g, ' ').replace(/<br\/?>/g, '\n'),
|
||||
tracks: subtitle.languages || [Ox.getLanguageNameByCode(pandora.site.language)]
|
||||
};
|
||||
}) : [];
|
||||
};
|
||||
|
||||
pandora.getSubtitlesLayer = function() {
|
||||
return pandora.site.layers.filter(function(layer) {
|
||||
return layer.isSubtitles;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue