forked from 0x2620/oxjs
player/timeline: differentiate between drag (positioning event) and dragend (position event), fixes #1657
This commit is contained in:
parent
a9c60fe05f
commit
e93b196e67
5 changed files with 38 additions and 13 deletions
|
|
@ -232,6 +232,9 @@ Ox.VideoEditPanel = function(options, self) {
|
|||
position: function(data) {
|
||||
setPosition(data.position);
|
||||
},
|
||||
positioning: function(data) {
|
||||
setPosition(data.position, false, true);
|
||||
},
|
||||
resolution: function(data) {
|
||||
that.triggerEvent('resolution', data);
|
||||
},
|
||||
|
|
@ -363,10 +366,13 @@ Ox.VideoEditPanel = function(options, self) {
|
|||
})
|
||||
);
|
||||
|
||||
function changeTimeline(data) {
|
||||
function dragTimeline(data) {
|
||||
self.options.position = data.position;
|
||||
self.$video.options({position: self.options.position});
|
||||
self.$clipPanel.options({position: self.options.position});
|
||||
}
|
||||
|
||||
function dragendTimeline() {
|
||||
that.triggerEvent('position', {position: self.options.position});
|
||||
}
|
||||
|
||||
|
|
@ -436,7 +442,8 @@ Ox.VideoEditPanel = function(options, self) {
|
|||
.css({left: '4px', top: '4px'})
|
||||
.bindEvent({
|
||||
mousedown: that.gainFocus,
|
||||
position: changeTimeline
|
||||
position: dragendTimeline,
|
||||
positioning: dragTimeline,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -504,14 +511,14 @@ Ox.VideoEditPanel = function(options, self) {
|
|||
}
|
||||
}
|
||||
|
||||
function setPosition(position, playing) {
|
||||
function setPosition(position, playing, dragging) {
|
||||
var minute = Math.floor(position / 60),
|
||||
previousMinute = Math.floor(self.options.position / 60);
|
||||
self.options.position = position;
|
||||
!playing && self.$video.options({position: self.options.position});
|
||||
self.$timeline.options({position: self.options.position});
|
||||
self.$clipPanel.options({position: self.options.position});
|
||||
if (!playing || minute != previousMinute) {
|
||||
if ((!playing || minute != previousMinute) && !dragging) {
|
||||
that.triggerEvent('position', {
|
||||
position: !playing ? self.options.position : minute * 60
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue