change video resolution, close tv
This commit is contained in:
parent
948423fee4
commit
8e40f95f0d
7 changed files with 45 additions and 19 deletions
|
@ -644,6 +644,7 @@
|
|||
"sidebarSize": 256,
|
||||
"theme": "modern",
|
||||
"videoPoints": {},
|
||||
"videoResolution": 96,
|
||||
"videoScale": "fit",
|
||||
"videoMuted": false,
|
||||
"videoSize": "small",
|
||||
|
|
|
@ -75,7 +75,7 @@ def update_static():
|
|||
for f in files:
|
||||
if f.endswith('.js') and len(f.split('.')) == 2:
|
||||
f = os.path.join(root, f)
|
||||
fsite = f.replace('.js', '.%s.js' % settings.SITENAME)
|
||||
fsite = f.replace('.js', '.%s.js' % settings.CONFIG['site']['id'])
|
||||
if os.path.exists(fsite):
|
||||
f = fsite
|
||||
js.append(f[len(settings.STATIC_ROOT)+1:])
|
||||
|
|
|
@ -42,12 +42,12 @@
|
|||
],
|
||||
// fixme: either this, or filter: true in itemKeys, but not both
|
||||
"filters": [
|
||||
{"id": "collection", "title": "Collection", "type": "string"},
|
||||
{"id": "source", "title": "Source", "type": "string"},
|
||||
{"id": "director", "title": "Director", "type": "string"},
|
||||
{"id": "location", "title": "Location", "type": "string"},
|
||||
{"id": "year", "title": "Year", "type": "integer"},
|
||||
{"id": "language", "title": "Language", "type": "string"},
|
||||
{"id": "source", "title": "Source", "type": "string"},
|
||||
{"id": "collection", "title": "Collection", "type": "string"},
|
||||
{"id": "category", "title": "Category", "type": "string"},
|
||||
{"id": "writer", "title": "Writer", "type": "string"},
|
||||
{"id": "producer", "title": "Producer", "type": "string"},
|
||||
|
@ -488,6 +488,9 @@
|
|||
{"id": "size", "admin": true},
|
||||
{"id": "pixels"}
|
||||
],
|
||||
"tv": {
|
||||
"showLogo": false
|
||||
},
|
||||
"user": {
|
||||
"level": "guest",
|
||||
"ui": {
|
||||
|
@ -500,10 +503,10 @@
|
|||
}
|
||||
},
|
||||
"filters": [
|
||||
{"id": "director", "sort": [{"key": "items", "operator": "-"}]},
|
||||
{"id": "source", "sort": [{"key": "items", "operator": "-"}]},
|
||||
{"id": "collection", "sort": [{"key": "name", "operator": "-"}]},
|
||||
{"id": "source", "sort": [{"key": "items", "operator": "-"}]},
|
||||
{"id": "category", "sort": [{"key": "items", "operator": "-"}]},
|
||||
{"id": "keyword", "sort": [{"key": "items", "operator": "-"}]},
|
||||
{"id": "location", "sort": [{"key": "items", "operator": "-"}]}
|
||||
],
|
||||
"filtersSize": 176,
|
||||
|
@ -548,6 +551,7 @@
|
|||
"sidebarSize": 256,
|
||||
"theme": "classic",
|
||||
"videoPoints": {},
|
||||
"videoResolution": 96,
|
||||
"videoScale": "fit",
|
||||
"videoMuted": false,
|
||||
"videoSize": "small",
|
||||
|
|
|
@ -203,7 +203,6 @@ appPanel
|
|||
site: data.site,
|
||||
user: data.user
|
||||
});
|
||||
|
||||
// make sure all valid ui settings are present
|
||||
pandora.user.ui = Ox.extend(
|
||||
Ox.clone(pandora.site.user.ui), pandora.user.ui
|
||||
|
|
|
@ -133,6 +133,7 @@ pandora.ui.item = function() {
|
|||
muted: pandora.user.ui.videoMuted,
|
||||
out: pandora.user.ui.videoPoints[pandora.user.ui.item].out,
|
||||
position: pandora.user.ui.videoPoints[pandora.user.ui.item].position,
|
||||
resolution: pandora.user.ui.videoResolution,
|
||||
scaleToFill: pandora.user.ui.videoScale == 'fill',
|
||||
showAnnotations: pandora.user.ui.showAnnotations,
|
||||
showTimeline: pandora.user.ui.showTimeline,
|
||||
|
@ -161,6 +162,9 @@ pandora.ui.item = function() {
|
|||
resizeannotations: function(data) {
|
||||
pandora.UI.set('annotationsSize', data.annotationsSize);
|
||||
},
|
||||
resolution: function(data) {
|
||||
pandora.UI.set('videoResolution', data.resolution);
|
||||
},
|
||||
scale: function(data) {
|
||||
pandora.UI.set('videoScale', data.scale);
|
||||
},
|
||||
|
@ -185,7 +189,7 @@ pandora.ui.item = function() {
|
|||
pandora.$ui.contentPanel.replaceElement(1,
|
||||
pandora.$ui.editor = Ox.VideoEditor({
|
||||
annotationsSize: pandora.user.ui.annotationsSize,
|
||||
censored: censored,
|
||||
censored: videoOptions.censored,
|
||||
cuts: result.data.cuts || [],
|
||||
duration: result.data.duration,
|
||||
find: pandora.user.ui.itemFind.conditions[0]
|
||||
|
@ -202,16 +206,17 @@ pandora.ui.item = function() {
|
|||
height: pandora.$ui.contentPanel.size(1),
|
||||
id: 'editor',
|
||||
'in': pandora.user.ui.videoPoints[pandora.user.ui.item]['in'],
|
||||
layers: layers,
|
||||
layers: videoOptions.layers,
|
||||
muted: pandora.user.ui.videoMuted,
|
||||
out: pandora.user.ui.videoPoints[pandora.user.ui.item].out,
|
||||
position: pandora.user.ui.videoPoints[pandora.user.ui.item].position,
|
||||
posterFrame: parseInt(video.duration / 2),
|
||||
posterFrame: parseInt(videoOptions.video.duration / 2),
|
||||
resolution: pandora.user.ui.videoResolution,
|
||||
showAnnotations: pandora.user.ui.showAnnotations,
|
||||
showLargeTimeline: true,
|
||||
subtitles: subtitles,
|
||||
subtitles: videoOptions.subtitles,
|
||||
tooltips: true,
|
||||
video: video,
|
||||
video: videoOptions.video,
|
||||
videoRatio: result.data.videoRatio,
|
||||
videoSize: pandora.user.ui.videoSize,
|
||||
volume: pandora.user.ui.videoVolume,
|
||||
|
@ -247,6 +252,9 @@ pandora.ui.item = function() {
|
|||
resizeend: function(data) {
|
||||
pandora.UI.set({annotationsSize: data.size});
|
||||
},
|
||||
resolution: function(data) {
|
||||
pandora.UI.set('videoResolution', data.resolution);
|
||||
},
|
||||
togglesize: function(data) {
|
||||
pandora.UI.set({videoSize: data.size});
|
||||
},
|
||||
|
|
|
@ -20,7 +20,7 @@ pandora.ui.tv = function() {
|
|||
list: pandora.user.ui._list
|
||||
}, function(result) {
|
||||
var videoOptions = pandora.getVideoOptions(result.data);
|
||||
$player && player.remove();
|
||||
$player && $player.remove();
|
||||
$player = Ox.VideoPlayer({
|
||||
censored: videoOptions.censored,
|
||||
controlsBottom: ['volume', 'scale', 'timeline', 'position', 'resolution'],
|
||||
|
@ -29,6 +29,7 @@ pandora.ui.tv = function() {
|
|||
fullscreen: true,
|
||||
logo: pandora.site.tv.showLogo ? '/static/png/logo256.png' : '',
|
||||
position: result.data.position,
|
||||
resolution: pandora.user.ui.videoResolution,
|
||||
scaleToFill: pandora.user.ui.videoScale == 'fill',
|
||||
subtitles: videoOptions.subtitles,
|
||||
tooltips: true,
|
||||
|
@ -45,10 +46,11 @@ pandora.ui.tv = function() {
|
|||
volume: pandora.user.ui.videoVolume
|
||||
})
|
||||
.bindEvent({
|
||||
close: function() {
|
||||
|
||||
},
|
||||
ended: play
|
||||
close: that.fadeOutScreen,
|
||||
ended: play,
|
||||
resolution: function(data) {
|
||||
pandora.UI.set('videoResolution', data.resolution);
|
||||
}
|
||||
})
|
||||
.appendTo(that);
|
||||
});
|
||||
|
@ -57,21 +59,29 @@ pandora.ui.tv = function() {
|
|||
that.fadeInScreen = function() {
|
||||
that.appendTo(Ox.UI.$body).animate({opacity: 1}, 500);
|
||||
play();
|
||||
return that;
|
||||
};
|
||||
|
||||
that.fadeOutScreen = function() {
|
||||
|
||||
that.animate({opacity: 0}, 500, function() {
|
||||
that.remove();
|
||||
});
|
||||
pandora.UI.set('page', '');
|
||||
return that;
|
||||
};
|
||||
|
||||
that.hideScreen = function() {
|
||||
|
||||
that.remove();
|
||||
pandora.UI.set('page', '');
|
||||
return that;
|
||||
};
|
||||
|
||||
that.showScreen = function() {
|
||||
that.css({opacity: 1}).appendTo(Ox.UI.$body);
|
||||
play();
|
||||
return that;
|
||||
};
|
||||
|
||||
return that;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -760,6 +760,10 @@ pandora.getVideoOptions = function(data) {
|
|||
+ resolution + 'p' + part + '.' + pandora.user.videoFormat;
|
||||
});
|
||||
});
|
||||
options.layers = [];
|
||||
pandora.site.layers.forEach(function(layer, i) {
|
||||
options.layers[i] = Ox.extend({}, layer, {items: data.layers[layer.id]});
|
||||
});
|
||||
return options;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue