From 8aa95d35f2116c75417db452069e7413f5cd9041 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 16 Sep 2014 13:07:09 +0200 Subject: [PATCH] pass subtitlesDefaultTrack and resolution in editor --- static/js/editPanel.js | 8 +++----- static/js/utils.js | 3 ++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/static/js/editPanel.js b/static/js/editPanel.js index 938d6776..b4c62469 100644 --- a/static/js/editPanel.js +++ b/static/js/editPanel.js @@ -431,6 +431,8 @@ pandora.ui.editPanel = function(isEmbed) { paused: true, showIconOnLoad: true, subtitles: getSubtitles(edit.clips), + subtitlesDefaultTrack: Ox.getLanguageNameByCode(pandora.site.language), + subtitlesTrack: Ox.getLanguageNameByCode(pandora.site.language), timeline: getSmallTimelineURL(), video: getVideos(), volume: ui.videoVolume, @@ -494,11 +496,7 @@ pandora.ui.editPanel = function(isEmbed) { function getSubtitles(clips) { var subtitles = [], - subtitlesLayer = pandora.site.layers.filter(function(layer) { - return layer.isSubtitles; - }).map(function(layer) { - return layer.id; - })[0]; + subtitlesLayer = pandora.getSubtitlesLayer(); subtitlesLayer && clips.map(function(clip) { if (clip.layers[subtitlesLayer]) { clip.layers[subtitlesLayer].forEach(function(subtitle) { diff --git a/static/js/utils.js b/static/js/utils.js index 7c1853a6..a2c10783 100644 --- a/static/js/utils.js +++ b/static/js/utils.js @@ -920,7 +920,8 @@ pandora.getClipVideos = function(clip, resolution) { resolution = resolution || pandora.user.ui.videoResolution; return Ox.flatten(Ox.range(clip.parts).map(function(i) { var item = { - src: pandora.getVideoURL(clip.item, resolution, i + 1) + src: pandora.getVideoURL(clip.item, resolution, i + 1), + resolution: resolution }; if (currentTime + clip.durations[i] <= start || currentTime > end) { item = null;