forked from 0x2620/oxjs
update VideoEditPanel and ClipPanel (select clip at position, update selection on cut)
This commit is contained in:
parent
71ef581b80
commit
7db11814e3
2 changed files with 51 additions and 36 deletions
|
|
@ -88,10 +88,10 @@ Ox.VideoEditPanel = function(options, self) {
|
|||
position: function() {
|
||||
self.$video.options({position: self.options.position});
|
||||
self.$timeline.options({position: self.options.position});
|
||||
self.$annotationPanel.options({position: self.options.position});
|
||||
self.$clipPanel.options({position: self.options.position});
|
||||
},
|
||||
selected: function() {
|
||||
self.$annotationPanel.options({selected: self.options.selected});
|
||||
self.$clipPanel.options({selected: self.options.selected});
|
||||
},
|
||||
showClips: function() {
|
||||
self.$mainPanel.toggle(1);
|
||||
|
|
@ -130,7 +130,11 @@ Ox.VideoEditPanel = function(options, self) {
|
|||
.bindEvent({
|
||||
//resize: resizeElement,
|
||||
key_0: toggleMuted,
|
||||
key_backslash: selectClip,
|
||||
key_backslash: function() {
|
||||
if (self.options.view != 'annotations') {
|
||||
self.$clipPanel.selectClip();
|
||||
}
|
||||
},
|
||||
key_closebracket: function() {
|
||||
movePositionTo('chapter', 1);
|
||||
},
|
||||
|
|
@ -178,6 +182,9 @@ Ox.VideoEditPanel = function(options, self) {
|
|||
key_shift_o: function() {
|
||||
goToPoint('out');
|
||||
},
|
||||
key_slash: function() {
|
||||
// TODO: selectCut
|
||||
},
|
||||
key_shift_right: function() {
|
||||
movePositionBy(1);
|
||||
},
|
||||
|
|
@ -566,19 +573,6 @@ Ox.VideoEditPanel = function(options, self) {
|
|||
that.triggerEvent('size', data.size);
|
||||
}
|
||||
|
||||
function selectClip() {
|
||||
var id = Ox.last(self.options.clips).id;
|
||||
Ox.forEach(self.options.clips, function(clip, i) {
|
||||
if (clip.position > self.options.position) {
|
||||
id = self.options.clips[i - 1].id;
|
||||
return false; // break
|
||||
}
|
||||
});
|
||||
self.options.selected = [id];
|
||||
self.$clipPanel.options({selected: self.options.selected});
|
||||
that.triggerEvent('select', {id: self.options.selected});
|
||||
}
|
||||
|
||||
function setPoint(point, position, triggerEvent) {
|
||||
self.options[point] = position;
|
||||
self.$video.options(point, position);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue