pass audioTrack, expand languages before passing
This commit is contained in:
parent
32719a212c
commit
afae94a1be
3 changed files with 14 additions and 17 deletions
|
@ -14,6 +14,7 @@ pandora.ui.editor = function(data) {
|
||||||
annotationsSort: ui.annotationsSort,
|
annotationsSort: ui.annotationsSort,
|
||||||
annotationsTooltip: Ox._('annotations')
|
annotationsTooltip: Ox._('annotations')
|
||||||
+ ' <span class="OxBright">' + Ox.SYMBOLS.SHIFT + 'A</span>',
|
+ ' <span class="OxBright">' + Ox.SYMBOLS.SHIFT + 'A</span>',
|
||||||
|
audioTrack: data.audioTrack,
|
||||||
censored: data.censored,
|
censored: data.censored,
|
||||||
censoredIcon: pandora.site.cantPlay.icon,
|
censoredIcon: pandora.site.cantPlay.icon,
|
||||||
censoredTooltip: Ox._(pandora.site.cantPlay.text),
|
censoredTooltip: Ox._(pandora.site.cantPlay.text),
|
||||||
|
@ -60,8 +61,9 @@ pandora.ui.editor = function(data) {
|
||||||
showLayers: Ox.clone(ui.showLayers),
|
showLayers: Ox.clone(ui.showLayers),
|
||||||
showUsers: pandora.site.annotations.showUsers,
|
showUsers: pandora.site.annotations.showUsers,
|
||||||
subtitles: data.subtitles,
|
subtitles: data.subtitles,
|
||||||
subtitlesDefaultTrack: pandora.site.language,
|
subtitlesDefaultTrack: Ox.getLanguageNameByCode(pandora.site.language),
|
||||||
subtitlesLayer: data.subtitlesLayer,
|
subtitlesLayer: data.subtitlesLayer,
|
||||||
|
subtitlesTrack: Ox.getLanguageNameByCode(pandora.site.language),
|
||||||
timeline: ui.videoTimeline,
|
timeline: ui.videoTimeline,
|
||||||
timelines: pandora.site.timelines,
|
timelines: pandora.site.timelines,
|
||||||
video: data.video,
|
video: data.video,
|
||||||
|
|
|
@ -14,7 +14,7 @@ pandora.ui.player = function(data) {
|
||||||
annotationsSort: ui.annotationsSort,
|
annotationsSort: ui.annotationsSort,
|
||||||
annotationsTooltip: Ox._('annotations')
|
annotationsTooltip: Ox._('annotations')
|
||||||
+ ' <span class="OxBright">' + Ox.SYMBOLS.SHIFT + 'A</span>',
|
+ ' <span class="OxBright">' + Ox.SYMBOLS.SHIFT + 'A</span>',
|
||||||
audioTrack: data.audioTracks ? data.audioTracks[0] : void 0,
|
audioTrack: data.audioTrack,
|
||||||
censored: data.censored,
|
censored: data.censored,
|
||||||
censoredIcon: pandora.site.cantPlay.icon,
|
censoredIcon: pandora.site.cantPlay.icon,
|
||||||
censoredTooltip: Ox._(pandora.site.cantPlay.text),
|
censoredTooltip: Ox._(pandora.site.cantPlay.text),
|
||||||
|
@ -49,8 +49,9 @@ pandora.ui.player = function(data) {
|
||||||
showUsers: pandora.site.annotations.showUsers,
|
showUsers: pandora.site.annotations.showUsers,
|
||||||
showTimeline: ui.showTimeline,
|
showTimeline: ui.showTimeline,
|
||||||
smallTimelineURL: pandora.getMediaURL('/' + ui.item + '/timeline16p.jpg'),
|
smallTimelineURL: pandora.getMediaURL('/' + ui.item + '/timeline16p.jpg'),
|
||||||
subtitles: data.subtitles,
|
subtitlesDefaultTrack: Ox.getLanguageNameByCode(pandora.site.language),
|
||||||
subtitlesDefaultTrack: pandora.site.language,
|
subtitlesLayer: data.subtitlesLayer,
|
||||||
|
subtitlesTrack: Ox.getLanguageNameByCode(pandora.site.language),
|
||||||
timeline: ui.videoTimeline,
|
timeline: ui.videoTimeline,
|
||||||
timelineTooltip: Ox._('timeline') + ' <span class="OxBright">' + Ox.SYMBOLS.SHIFT + 'T</span>',
|
timelineTooltip: Ox._('timeline') + ' <span class="OxBright">' + Ox.SYMBOLS.SHIFT + 'T</span>',
|
||||||
video: data.video,
|
video: data.video,
|
||||||
|
|
|
@ -1758,18 +1758,6 @@ pandora.getVideoOptions = function(data) {
|
||||||
}).map(function(layer) {
|
}).map(function(layer) {
|
||||||
return layer.id;
|
return layer.id;
|
||||||
})[0];
|
})[0];
|
||||||
options.subtitles = options.subtitlesLayer
|
|
||||||
? data.layers[options.subtitlesLayer].map(function(subtitle) {
|
|
||||||
return Ox.extend({
|
|
||||||
id: subtitle.id,
|
|
||||||
'in': subtitle['in'],
|
|
||||||
out: subtitle.out,
|
|
||||||
text: subtitle.value.replace(/\n/g, ' ').replace(/<br\/?>/g, '\n')
|
|
||||||
}, subtitle.languages ? {
|
|
||||||
tracks: subtitle.languages
|
|
||||||
} : {});
|
|
||||||
})
|
|
||||||
: [];
|
|
||||||
options.censored = canPlayVideo ? []
|
options.censored = canPlayVideo ? []
|
||||||
: canPlayClips ? (
|
: canPlayClips ? (
|
||||||
options.subtitles.length
|
options.subtitles.length
|
||||||
|
@ -1800,7 +1788,7 @@ pandora.getVideoOptions = function(data) {
|
||||||
options.video.push({
|
options.video.push({
|
||||||
duration: data.durations[i],
|
duration: data.durations[i],
|
||||||
index: i,
|
index: i,
|
||||||
track: track,
|
track: Ox.getLanguageNameByCode(track),
|
||||||
resolution: resolution,
|
resolution: resolution,
|
||||||
src: pandora.getVideoURL(data.item || pandora.user.ui.item, resolution, i + 1, track)
|
src: pandora.getVideoURL(data.item || pandora.user.ui.item, resolution, i + 1, track)
|
||||||
});
|
});
|
||||||
|
@ -1817,6 +1805,7 @@ pandora.getVideoOptions = function(data) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
options.audioTrack = data.audioTracks ? Ox.getLanguageNameByCode(data.audioTracks[0]) : void 0;
|
||||||
options.annotations = [];
|
options.annotations = [];
|
||||||
pandora.site.layers.forEach(function(layer, i) {
|
pandora.site.layers.forEach(function(layer, i) {
|
||||||
options.annotations[i] = Ox.extend({}, layer, {
|
options.annotations[i] = Ox.extend({}, layer, {
|
||||||
|
@ -1827,6 +1816,11 @@ pandora.getVideoOptions = function(data) {
|
||||||
annotation.editable = annotation.editable
|
annotation.editable = annotation.editable
|
||||||
|| annotation.user == pandora.user.username
|
|| annotation.user == pandora.user.username
|
||||||
|| pandora.site.capabilities['canEditAnnotations'][pandora.user.level];
|
|| pandora.site.capabilities['canEditAnnotations'][pandora.user.level];
|
||||||
|
annotation.languages = (
|
||||||
|
annotation.languages || [pandora.site.language]
|
||||||
|
).map(function(language) {
|
||||||
|
return Ox.getLanguageNameByCode(language);
|
||||||
|
});
|
||||||
return annotation;
|
return annotation;
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue