Skip to content

Commit

Permalink
fix(ui): (keyboard)ignore uppercase
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyiya committed Nov 16, 2024
1 parent 0bc0007 commit 9abba53
Show file tree
Hide file tree
Showing 7 changed files with 848 additions and 861 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@

- **Feel free to submit yours in [Let me know!](https://github.com/shiyiya/oplayer/discussions/116)**
- [UPV](https://onime.netlify.app) - free anime no ads
- [Binged](https://binge.lol) - Binged - Watch Movies & TV Shows Free
- [NUSANIME](https://play.google.com/store/apps/details?id=com.nusanime.app) - Nonton Anime Sub Indo | Nonton Anime Subtitle Indonesia Gratis

## Support

Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,31 +34,31 @@
"lint": "prettier -w ./packages/*/**/*.ts"
},
"devDependencies": {
"@babel/core": "^7.25.8",
"@babel/core": "^7.26.0",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-destructuring": "^7.25.7",
"@babel/plugin-transform-logical-assignment-operators": "^7.25.8",
"@babel/plugin-transform-nullish-coalescing-operator": "^7.25.8",
"@babel/plugin-transform-object-rest-spread": "^7.25.8",
"@babel/plugin-transform-parameters": "^7.25.7",
"@babel/plugin-transform-spread": "^7.25.7",
"@babel/plugin-transform-template-literals": "^7.25.7",
"@babel/plugin-transform-destructuring": "^7.25.9",
"@babel/plugin-transform-logical-assignment-operators": "^7.25.9",
"@babel/plugin-transform-nullish-coalescing-operator": "^7.25.9",
"@babel/plugin-transform-object-rest-spread": "^7.25.9",
"@babel/plugin-transform-parameters": "^7.25.9",
"@babel/plugin-transform-spread": "^7.25.9",
"@babel/plugin-transform-template-literals": "^7.25.9",
"@changesets/cli": "^2.27.9",
"@rollup/plugin-babel": "^6.0.4",
"@types/node": "^20.16.12",
"@vitejs/plugin-react": "^4.3.2",
"@types/node": "^20.17.6",
"@vitejs/plugin-react": "^4.3.3",
"babel-plugin-syntax-trailing-function-commas": "^6.22.0",
"concurrently": "^8.2.2",
"cross-env": "^7.0.3",
"jsdom": "^24.1.3",
"lint-staged": "^15.2.10",
"nx": "^19.8.6",
"nx": "^19.8.11",
"prettier": "^3.3.3",
"rimraf": "^5.0.10",
"terser": "^5.36.0",
"tslib": "^2.8.0",
"tslib": "^2.8.1",
"typescript": "^5.6.3",
"vite": "^5.4.9",
"vite": "^5.4.11",
"vite-plugin-banner": "^0.7.1",
"vite-plugin-merge-exports": "^0.0.0",
"vitest": "^1.6.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
"@oplayer/torrent": "workspace:*",
"@oplayer/ui": "workspace:*",
"mdx-embed": "^1.1.2",
"next": "^14.2.15",
"next": "^14.2.18",
"nextra": "^2.13.4",
"nextra-theme-docs": "^2.13.4",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@types/react": "^18.3.11",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"sass": "^1.80.2"
"sass": "^1.81.0"
}
}
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"devDependencies": {
"@oplayer/core": "workspace:*",
"@types/react": "^18.3.11",
"@types/react": "^18.3.12",
"react": "^18.3.1",
"react-dom": "^18.3.1"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/torrent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
"devDependencies": {
"@oplayer/core": "workspace:*",
"@types/webtorrent": "^0.109.8",
"@types/webtorrent": "^0.109.10",
"webtorrent": "0.98.18"
}
}
12 changes: 6 additions & 6 deletions packages/ui/src/functions/keyboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const KEY_FN: Record<string, (player: Player, config: UIInterface['config']) =>
},

' ': (player: Player) => player.togglePlay(),
k: (player: Player) => player.togglePlay(),
K: (player: Player) => player.togglePlay(),

Escape: (player: Player) => {
if (player.isFullScreen) {
Expand All @@ -53,13 +53,13 @@ const KEY_FN: Record<string, (player: Player, config: UIInterface['config']) =>
}
},

f: (player: Player) => player.toggleFullScreen(),
F: (player: Player) => player.toggleFullScreen(),

w: (player: Player) => player.emit('fullscreenchange', { isWeb: true }),
W: (player: Player) => player.emit('fullscreenchange', { isWeb: true }),

s: screenShot,
S: screenShot,

m: (player: Player) => (player.isMuted ? player.unmute() : player.mute())
M: (player: Player) => (player.isMuted ? player.unmute() : player.mute())
}

export default function (it: UIInterface) {
Expand All @@ -83,7 +83,7 @@ export default function (it: UIInterface) {
return
}

const key = e.key
const key = e.key.toLocaleUpperCase()

if (KEY_FN[key]) {
e.preventDefault()
Expand Down
Loading

0 comments on commit 9abba53

Please sign in to comment.