seeking, autonext song

This commit is contained in:
Blue 2019-01-26 21:54:22 +03:00
parent e690d67b80
commit 6e933257b1
7 changed files with 294 additions and 66 deletions

View file

@ -30,9 +30,9 @@
this._y = 0;
this._e.addEventListener("mousedown", this._proxy.onMouseDown, false);
this._e.addEventListener("touchstart", this._touch, false);
this._e.addEventListener("touchmove", this._touch, false);
this._e.addEventListener("touchend", this._touch, false);
this._e.addEventListener("touchstart", W.touchToMouse, false);
this._e.addEventListener("touchmove", W.touchToMouse, false);
this._e.addEventListener("touchend", W.touchToMouse, false);
},
"destructor": function () {
if (this._dragging) {
@ -45,9 +45,9 @@
}
this._e.removeEventListener("mousedown", this._proxy.onMouseDown);
this._e.removeEventListener("touchstart", this._touch);
this._e.removeEventListener("touchmove", this._touch);
this._e.removeEventListener("touchend", this._touch);
this._e.removeEventListener("touchstart", W.touchToMouse);
this._e.removeEventListener("touchmove", W.touchToMouse);
this._e.removeEventListener("touchend", W.touchToMouse);
Subscribable.fn.destructor.call(this);
},
@ -105,41 +105,6 @@
this._v.trigger("dragEnd");
return false;
}
},
"_touch": function (e) {
e.preventDefault();
if (e.touches.length > 1 || (e.type == "touchend" && e.touches.length > 0))
return;
var type = null;
var touch = null;
var src = e.currentTarget;
switch (e.type) {
case "touchstart":
type = "mousedown";
touch = e.changedTouches[0];
break;
case "touchmove":
type = "mousemove";
touch = e.changedTouches[0];
src = window;
break;
case "touchend":
type = "mouseup";
touch = e.changedTouches[0];
src = window;
break;
}
var event = new MouseEvent(type, {
button: 0,
screenX: touch.screenX,
screenY: touch.screenY,
clientX: touch.clientX,
clientY: touch.clientY
});
src.dispatchEvent(event);
}
});