mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-08-14 23:57:27 +00:00
When double click on mobile outside the controls/buttons scrool 10 seconds forward or backward
This commit is contained in:
parent
71eed763e4
commit
de306295a9
1 changed files with 21 additions and 0 deletions
|
@ -241,6 +241,27 @@ export default {
|
|||
},
|
||||
},
|
||||
activated() {
|
||||
const videoEl = this.$refs.videoEl;
|
||||
var lastClick = new Date();
|
||||
document.addEventListener("click", function(event) {
|
||||
var t = event.target;
|
||||
while (t && t !== this) {
|
||||
if (t.matches(".shaka-mobile.shaka-video-container")) {
|
||||
if ((new Date() - lastClick) < 400) {
|
||||
var videoMiddlePX = videoEl.offsetWidth / 2;
|
||||
if (videoMiddlePX < event.layerX) {
|
||||
videoEl.currentTime = videoEl.currentTime + 10;
|
||||
} else {
|
||||
videoEl.currentTime = videoEl.currentTime - 10;
|
||||
}
|
||||
videoEl.play();
|
||||
}
|
||||
lastClick = new Date();
|
||||
}
|
||||
t = t.parentNode;
|
||||
}
|
||||
});
|
||||
|
||||
import("hotkeys-js")
|
||||
.then(mod => mod.default)
|
||||
.then(hotkeys => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue