Skip to content

Commit

Permalink
fix: arrow keys
Browse files Browse the repository at this point in the history
  • Loading branch information
StoneyEagle committed Sep 30, 2024
1 parent da58c2f commit b00fedd
Show file tree
Hide file tree
Showing 17 changed files with 1,195 additions and 1,077 deletions.
470 changes: 241 additions & 229 deletions dist/desktopUIPlugin.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index2.js
Original file line number Diff line number Diff line change
Expand Up @@ -18676,7 +18676,7 @@ class Lh extends Jn {
dispose() {
clearTimeout(this.message), clearTimeout(this.leftTap), clearTimeout(this.rightTap), this.inactivityTimeout && clearTimeout(this.inactivityTimeout), this._removeEvents();
for (const e of Object.values(this.plugins))
typeof e.destroy == "function" && e.destroy();
console.log("Disposing plugin", e), e.dispose();
this.plugins = {}, this.hls && (this.hls.destroy(), this.hls = void 0), this.gainNode && (this.removeGainNode(), this.gainNode = void 0), this.container && (this.container.innerHTML = ""), Pe.delete(this.playerId), this.emit("dispose"), this.off("all");
}
/**
Expand Down
12 changes: 6 additions & 6 deletions dist/keyHandlerPlugin.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import { P as l } from "./plugin.js";
class c extends l {
import { P as i } from "./plugin.js";
class c extends i {
initialize(e) {
this.player = e;
}
use() {
this.player.options.disableControls || (document.removeEventListener("keypress", this.keyHandler.bind(this), !1), document.addEventListener("keypress", this.keyHandler.bind(this), !1));
this.player.options.disableControls || document.addEventListener("keyup", this.keyHandler.bind(this), !1);
}
dispose() {
document.removeEventListener("keypress", this.keyHandler.bind(this), !1);
document.removeEventListener("keyup", this.keyHandler.bind(this), !1);
}
/**
* Handles keyboard events and executes the corresponding function based on the key binding.
* @param {KeyboardEvent} event - The keyboard event to handle.
*/
keyHandler(e) {
var n, i;
var n, l;
if (((n = document.activeElement) == null ? void 0 : n.nodeName) == "INPUT")
return;
const t = this.keyBindings();
let a = !1;
this.player.getElement().getBoundingClientRect().width != 0 && (!a && this.player && (a = !0, t.some((o) => o.key === e.key && o.control === e.ctrlKey) && (e.preventDefault(), (i = t.find((o) => o.key === e.key && o.control === e.ctrlKey)) == null || i.function())), setTimeout(() => {
this.player.getElement().getBoundingClientRect().width != 0 && (!a && this.player && (a = !0, t.some((o) => o.key === e.key && o.control === e.ctrlKey) && (e.preventDefault(), (l = t.find((o) => o.key === e.key && o.control === e.ctrlKey)) == null || l.function())), setTimeout(() => {
a = !1;
}, 300));
}
Expand Down
2 changes: 1 addition & 1 deletion dist/style.css

Large diffs are not rendered by default.

526 changes: 274 additions & 252 deletions dist/tvUIPlugin.js

Large diffs are not rendered by default.

Loading

0 comments on commit b00fedd

Please sign in to comment.