From e8094b5afa43e5857064a8e147a80d0cd9e94e0f Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 11 Jul 2013 18:57:40 +0000 Subject: [PATCH] support embeding lists in video view --- static/js/pandora/embedPanel.js | 2 ++ static/js/pandora/videoView.js | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/static/js/pandora/embedPanel.js b/static/js/pandora/embedPanel.js index 6a7d5a063..ab68aea03 100644 --- a/static/js/pandora/embedPanel.js +++ b/static/js/pandora/embedPanel.js @@ -12,6 +12,8 @@ pandora.ui.embedPanel = function() { if (!ui.item) { if (Ox.contains(['grid', 'clip'], view)) { that = pandora.ui.embedError(true); + } else if (view == 'video') { + that = pandora.ui.videoView(true); } else if (Ox.contains(['map', 'calendar'], view)) { that = pandora.ui.embedNavigation(view); } diff --git a/static/js/pandora/videoView.js b/static/js/pandora/videoView.js index 1cfa8d4f7..6f2ba951e 100644 --- a/static/js/pandora/videoView.js +++ b/static/js/pandora/videoView.js @@ -1,7 +1,7 @@ // vim: et:ts=4:sw=4:sts=4:ft=javascript 'use strict'; -pandora.ui.videoView = function() { +pandora.ui.videoView = function(isEmbed) { var ui = pandora.user.ui, itemsQuery, query, @@ -54,22 +54,20 @@ pandora.ui.videoView = function() { range: range, sort: pandora.user.ui.listSort }, function(result) { - pandora.$ui.statusbar.set('total', { + pandora.$ui.statusbar && pandora.$ui.statusbar.set('total', { items: result.data.items.length }); player && player.remove(); player = Ox.VideoPlayer({ controlsBottom: ['play', 'previous', 'next', 'volume'], - controlsTop: ['fullscreen', 'scale'], + controlsTop: (isEmbed ? [] : ['fullscreen']).concat(['scale']), enableMouse: true, height: getHeight(), paused: true, position: 0, video: Ox.flatten(result.data.items.map(function(clip) { clip.item = clip.id.split('/')[0]; - var r = pandora.getClipVideos(clip); - console.log(clip, r); - return r; + return pandora.getClipVideos(clip); })), width: getWidth() }).appendTo(that); @@ -77,11 +75,15 @@ pandora.ui.videoView = function() { } function getHeight() { - return that.height(); + return isEmbed + ? window.innerHeight + : that.height(); } function getWidth() { - return that.width(); + return isEmbed + ? window.innerWidth + : that.width(); } that.reloadList = function() {