forked from 0x2620/oxjs
update video editor
This commit is contained in:
parent
b2e8b2ac82
commit
f61e39a788
9 changed files with 141 additions and 80 deletions
|
|
@ -39,7 +39,9 @@ Ox.VideoPanel = function(options, self) {
|
|||
resolution: 0,
|
||||
scaleToFill: false,
|
||||
showAnnotations: false,
|
||||
showLayers: {},
|
||||
showTimeline: true,
|
||||
showUsers: false,
|
||||
subtitles: [],
|
||||
tooltips: false,
|
||||
video: '',
|
||||
|
|
@ -106,9 +108,11 @@ Ox.VideoPanel = function(options, self) {
|
|||
paused: function(data) {
|
||||
that.triggerEvent('paused', data);
|
||||
},
|
||||
playing: setPosition,
|
||||
playing: function(data) {
|
||||
setPosition(data.position, true);
|
||||
},
|
||||
position: function(data) {
|
||||
setPosition(data);
|
||||
setPosition(data.position);
|
||||
that.triggerEvent('position', data);
|
||||
},
|
||||
resolution: function(data) {
|
||||
|
|
@ -167,15 +171,20 @@ Ox.VideoPanel = function(options, self) {
|
|||
|
||||
self.$annotationPanel = Ox.AnnotationPanel({
|
||||
font: self.options.annotationsFont,
|
||||
'in': self.options['in'],
|
||||
layers: self.options.layers,
|
||||
out: self.options.out,
|
||||
position: self.options.position,
|
||||
range: self.options.annotationsRange,
|
||||
showFonts: true,
|
||||
showLayers: self.options.showLayers,
|
||||
showUsers: self.options.showUsers,
|
||||
sort: self.options.annotationsSort
|
||||
})
|
||||
.bindEvent({
|
||||
resize: resizeAnnotations,
|
||||
resizeend: resizeendAnnotations,
|
||||
select: selectAnnotation,
|
||||
toggle: toggleAnnotations
|
||||
});
|
||||
|
||||
|
|
@ -200,6 +209,7 @@ Ox.VideoPanel = function(options, self) {
|
|||
function changeTimeline(data) {
|
||||
self.options.position = data.position;
|
||||
self.$video.options({position: self.options.position});
|
||||
self.$annotationPanel.options({position: self.options.position});
|
||||
that.triggerEvent('position', {position: self.options.position});
|
||||
}
|
||||
|
||||
|
|
@ -256,12 +266,27 @@ Ox.VideoPanel = function(options, self) {
|
|||
});
|
||||
}
|
||||
|
||||
function setPosition(data) {
|
||||
self.options.position = data.position;
|
||||
//self.$video.position(self.options.position);
|
||||
self.$timeline.options({
|
||||
position: self.options.position
|
||||
});
|
||||
function selectAnnotation(data) {
|
||||
self.options.selected = data.id;
|
||||
if (self.options.selected) {
|
||||
setPosition(data['in']);
|
||||
setPoint('in', data['in']);
|
||||
setPoint('out', data.out);
|
||||
}
|
||||
}
|
||||
|
||||
function setPoint(point, position) {
|
||||
self.options[point] = position;
|
||||
self.$video.options(point, position);
|
||||
self.$timeline.options(point, position);
|
||||
self.$annotationPanel.options(point, position);
|
||||
}
|
||||
|
||||
function setPosition(position, playing) {
|
||||
self.options.position = position;
|
||||
!playing && self.$video.options({position: self.options.position});
|
||||
self.$timeline.options({position: self.options.position});
|
||||
self.$annotationPanel.options({position: self.options.position});
|
||||
}
|
||||
|
||||
function toggleAnnotations(data) {
|
||||
|
|
@ -300,6 +325,9 @@ Ox.VideoPanel = function(options, self) {
|
|||
self.$timeline.options({
|
||||
position: value
|
||||
});
|
||||
self.$annotationPanel.options({
|
||||
position: value
|
||||
});
|
||||
} else if (key == 'showAnnotations') {
|
||||
that.$element.toggle(1);
|
||||
} else if (key == 'showTimeline') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue