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
|
|
@ -372,6 +372,9 @@ Ox.VideoEditor = function(options, self) {
|
|||
position: function(data) {
|
||||
setPosition(data.position);
|
||||
},
|
||||
positioning: function(data) {
|
||||
setPosition(data.position, false, true);
|
||||
},
|
||||
resolution: function(data) {
|
||||
that.triggerEvent('resolution', data);
|
||||
},
|
||||
|
|
@ -420,6 +423,9 @@ Ox.VideoEditor = function(options, self) {
|
|||
.bindEvent({
|
||||
position: function(data) {
|
||||
setPosition(data.position);
|
||||
},
|
||||
positioning: function(data) {
|
||||
setPosition(data.position, false, true);
|
||||
}
|
||||
})
|
||||
.appendTo(self.$editor);
|
||||
|
|
@ -1231,7 +1237,7 @@ Ox.VideoEditor = 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;
|
||||
|
|
@ -1240,7 +1246,7 @@ Ox.VideoEditor = function(options, self) {
|
|||
$timeline.options({position: self.options.position});
|
||||
});
|
||||
self.$annotationPanel.options({position: self.options.position});
|
||||
if (!playing || minute != previousMinute) {
|
||||
if ((!playing || minute != previousMinute) && !dragging) {
|
||||
that.triggerEvent(playing ? 'playing' : 'position', {
|
||||
position: !playing ? self.options.position : minute * 60
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue