Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion jquery.jplayer/jquery.jplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,7 @@
// domNode: undefined
// htmlDlyCmdId: undefined
// autohideId: undefined
// lastMousePosition: undefined
// cmdsIgnored
},
solution: { // Static Object: Defines the solutions built in jPlayer.
Expand Down Expand Up @@ -2501,13 +2502,30 @@
event = "mousemove.jPlayer",
namespace = ".jPlayerAutohide",
eventType = event + namespace,
handler = function() {
handler = function(sourceEvent) {
var mouseMoved = false;
if (self.internal.lastMousePosition != undefined) {
//get the change from last position to this position
var deltaX = self.internal.lastMousePosition.x - sourceEvent.clientX,
deltaY = self.internal.lastMousePosition.y - sourceEvent.clientY;
mouseMoved = (Math.abs(deltaX)>0) || (Math.abs(deltaY)>0);
} else {
mouseMoved = true;
}
// store current position for next method execution
self.internal.lastMousePosition = {
x : sourceEvent.clientX,
y : sourceEvent.clientY
};
// if mouse has been actually moved, do the gui fadeIn/fadeOut
if (mouseMoved) {
self.css.jq.gui.fadeIn(self.options.autohide.fadeIn, function() {
clearTimeout(self.internal.autohideId);
self.internal.autohideId = setTimeout( function() {
self.css.jq.gui.fadeOut(self.options.autohide.fadeOut);
}, self.options.autohide.hold);
});
}
};

if(this.css.jq.gui.length) {
Expand All @@ -2518,6 +2536,8 @@

// Removes the fadeOut operation from the fadeIn callback.
clearTimeout(this.internal.autohideId);
// undefine lastMousePosition
delete this.internal.lastMousePosition;

this.element.unbind(namespace);
this.css.jq.gui.unbind(namespace);
Expand Down