update embed panel

This commit is contained in:
rolux 2013-02-20 17:28:28 +05:30
parent ff0dcf5028
commit 9da8d9a0a6

View file

@ -163,6 +163,21 @@ pandora.ui.embedPanel = function() {
} }
if (options.showAnnotations) { if (options.showAnnotations) {
if (options.playInToOut) {
video.annotations.forEach(function(layer) {
var items = [];
layer.items.forEach(function(item) {
if ((
item['in'] >= options['in'] && item['in'] <= options.out
) || (
item.out >= options['in'] && item.out <= options.out
)) {
items.push(item);
}
});
layer.items = items;
});
}
$annotations = Ox.AnnotationPanel(Ox.extend({ $annotations = Ox.AnnotationPanel(Ox.extend({
font: options.annotationsFont, font: options.annotationsFont,
layers: video.annotations, layers: video.annotations,
@ -170,7 +185,8 @@ pandora.ui.embedPanel = function() {
range: options.annotationsRange, range: options.annotationsRange,
showLayers: options.showLayers, showLayers: options.showLayers,
showUsers: true, showUsers: true,
sort: options.annotationsSort sort: options.annotationsSort,
width: window.innerWidth
}, options['in'] ? { }, options['in'] ? {
'in': options['in'] 'in': options['in']
} : {}, options.out ? { } : {}, options.out ? {
@ -293,9 +309,8 @@ pandora.ui.embedPanel = function() {
function selectAnnotation(data) { function selectAnnotation(data) {
if (data.id) { if (data.id) {
setPosition(data['in']); setPosition(Math.max(data['in'], options['in'] || 0));
//setPoint('in', data['in']); $annotations.options({selected: ''});
//setPoint('out', data.out);
} }
} }