video panel: suport in/out/copy; video edit panel: support in/out

This commit is contained in:
rlx 2013-07-14 16:24:19 +00:00
parent 155ada7992
commit 410e157cac
2 changed files with 53 additions and 5 deletions

View file

@ -99,12 +99,25 @@ Ox.VideoEditPanel = function(options, self) {
.bindEvent({ .bindEvent({
//resize: resizeElement, //resize: resizeElement,
key_0: toggleMuted, key_0: toggleMuted,
key_control_c: function() {
that.triggerEvent('copy', [{
annotation: self.options.selected,
'in': self.options['in'],
out: self.options.out
}]);
},
key_equal: function() { key_equal: function() {
self.$video.changeVolume(0.1); self.$video.changeVolume(0.1);
}, },
key_i: function() {
setPoint('in', self.options.position, true);
},
key_minus: function() { key_minus: function() {
self.$video.changeVolume(-0.1); self.$video.changeVolume(-0.1);
}, },
key_o: function() {
setPoint('out', self.options.position, true);
},
key_space: togglePaused key_space: togglePaused
}); });
@ -322,7 +335,7 @@ Ox.VideoEditPanel = function(options, self) {
.bindEvent({ .bindEvent({
mousedown: that.gainFocus, mousedown: that.gainFocus,
position: changeTimeline position: changeTimeline
}) });
} }
function getTimelineWidth() { function getTimelineWidth() {
@ -359,11 +372,21 @@ Ox.VideoEditPanel = function(options, self) {
that.triggerEvent('select', {id: self.options.selected}); that.triggerEvent('select', {id: self.options.selected});
} }
function setPoint(point, position) { function setPoint(point, position, triggerEvent) {
self.options[point] = position; self.options[point] = position;
self.$video.options(point, position); self.$video.options(point, position);
self.$timeline.options(point, position); self.$timeline.options(point, position);
self.$clipPanel.options(point, position); self.$clipPanel.options(point, position);
if (self.options['in'] > self.options.out) {
setPoint(point == 'in' ? 'out' : 'in', position);
}
if (triggerEvent) {
that.triggerEvent('points', {
'in': self.options['in'],
out: self.options.out,
position: self.options.position
});
}
} }
function setPosition(position, playing) { function setPosition(position, playing) {

View file

@ -19,8 +19,8 @@ Ox.VideoPanel <f> VideoPanel Object
position <!> position position <!> position
resizecalendar <!> resizecalendar resizecalendar <!> resizecalendar
resolution <!> resolution resolution <!> resolution
scale <!> scale scaleToFill <!> scale
select <!> select selected <!> select
subtitles <!> subtitles subtitles <!> subtitles
toggleannotations <!> toggleannotations toggleannotations <!> toggleannotations
togglecalendar <!> togglecalendar togglecalendar <!> togglecalendar
@ -126,12 +126,27 @@ Ox.VideoPanel = function(options, self) {
.bindEvent({ .bindEvent({
resize: resizeElement, resize: resizeElement,
key_0: toggleMuted, key_0: toggleMuted,
key_control_c: function() {
that.triggerEvent('copy', [{
annotation: self.options.selected,
'in': self.options['in'],
out: self.options.out
}]);
},
key_equal: function() { key_equal: function() {
self.$video.changeVolume(0.1); self.$video.changeVolume(0.1);
}, },
key_i: function() {
self.$annotationPanel.options({selected: ''});
setPoint('in', self.options.position, true);
},
key_minus: function() { key_minus: function() {
self.$video.changeVolume(-0.1); self.$video.changeVolume(-0.1);
}, },
key_o: function() {
self.$annotationPanel.options({selected: ''});
setPoint('out', self.options.position, true);
},
key_space: togglePaused key_space: togglePaused
}); });
@ -433,11 +448,21 @@ Ox.VideoPanel = function(options, self) {
that.triggerEvent('select', {id: self.options.selected}); that.triggerEvent('select', {id: self.options.selected});
} }
function setPoint(point, position) { function setPoint(point, position, triggerEvent) {
self.options[point] = position; self.options[point] = position;
self.$video.options(point, position); self.$video.options(point, position);
self.$timeline.options(point, position); self.$timeline.options(point, position);
self.$annotationPanel.options(point, position); self.$annotationPanel.options(point, position);
if (self.options['in'] > self.options.out) {
setPoint(point == 'in' ? 'out' : 'in', position);
}
if (triggerEvent) {
that.triggerEvent('points', {
'in': self.options['in'],
out: self.options.out,
position: self.options.position
});
}
} }
function setPosition(position, playing) { function setPosition(position, playing) {