forked from 0x2620/pandora
support embeding lists in video view
This commit is contained in:
parent
caa36c1470
commit
e8094b5afa
2 changed files with 12 additions and 8 deletions
|
@ -12,6 +12,8 @@ pandora.ui.embedPanel = function() {
|
||||||
if (!ui.item) {
|
if (!ui.item) {
|
||||||
if (Ox.contains(['grid', 'clip'], view)) {
|
if (Ox.contains(['grid', 'clip'], view)) {
|
||||||
that = pandora.ui.embedError(true);
|
that = pandora.ui.embedError(true);
|
||||||
|
} else if (view == 'video') {
|
||||||
|
that = pandora.ui.videoView(true);
|
||||||
} else if (Ox.contains(['map', 'calendar'], view)) {
|
} else if (Ox.contains(['map', 'calendar'], view)) {
|
||||||
that = pandora.ui.embedNavigation(view);
|
that = pandora.ui.embedNavigation(view);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// vim: et:ts=4:sw=4:sts=4:ft=javascript
|
// vim: et:ts=4:sw=4:sts=4:ft=javascript
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
pandora.ui.videoView = function() {
|
pandora.ui.videoView = function(isEmbed) {
|
||||||
var ui = pandora.user.ui,
|
var ui = pandora.user.ui,
|
||||||
itemsQuery,
|
itemsQuery,
|
||||||
query,
|
query,
|
||||||
|
@ -54,22 +54,20 @@ pandora.ui.videoView = function() {
|
||||||
range: range,
|
range: range,
|
||||||
sort: pandora.user.ui.listSort
|
sort: pandora.user.ui.listSort
|
||||||
}, function(result) {
|
}, function(result) {
|
||||||
pandora.$ui.statusbar.set('total', {
|
pandora.$ui.statusbar && pandora.$ui.statusbar.set('total', {
|
||||||
items: result.data.items.length
|
items: result.data.items.length
|
||||||
});
|
});
|
||||||
player && player.remove();
|
player && player.remove();
|
||||||
player = Ox.VideoPlayer({
|
player = Ox.VideoPlayer({
|
||||||
controlsBottom: ['play', 'previous', 'next', 'volume'],
|
controlsBottom: ['play', 'previous', 'next', 'volume'],
|
||||||
controlsTop: ['fullscreen', 'scale'],
|
controlsTop: (isEmbed ? [] : ['fullscreen']).concat(['scale']),
|
||||||
enableMouse: true,
|
enableMouse: true,
|
||||||
height: getHeight(),
|
height: getHeight(),
|
||||||
paused: true,
|
paused: true,
|
||||||
position: 0,
|
position: 0,
|
||||||
video: Ox.flatten(result.data.items.map(function(clip) {
|
video: Ox.flatten(result.data.items.map(function(clip) {
|
||||||
clip.item = clip.id.split('/')[0];
|
clip.item = clip.id.split('/')[0];
|
||||||
var r = pandora.getClipVideos(clip);
|
return pandora.getClipVideos(clip);
|
||||||
console.log(clip, r);
|
|
||||||
return r;
|
|
||||||
})),
|
})),
|
||||||
width: getWidth()
|
width: getWidth()
|
||||||
}).appendTo(that);
|
}).appendTo(that);
|
||||||
|
@ -77,11 +75,15 @@ pandora.ui.videoView = function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getHeight() {
|
function getHeight() {
|
||||||
return that.height();
|
return isEmbed
|
||||||
|
? window.innerHeight
|
||||||
|
: that.height();
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWidth() {
|
function getWidth() {
|
||||||
return that.width();
|
return isEmbed
|
||||||
|
? window.innerWidth
|
||||||
|
: that.width();
|
||||||
}
|
}
|
||||||
|
|
||||||
that.reloadList = function() {
|
that.reloadList = function() {
|
||||||
|
|
Loading…
Reference in a new issue