Comments (3)
pr welcome
from azusa-player.
pr welcome
忙,没空改,给个样子吧要是我下午晚上事情多顾不上你就自己改改
// 当用户按下空格键时触发的事件处理函数
useHotkeys('space', () => {
// 如果当前音频实例为空,直接返回
if (currentAudioInst === null) return;
// 如果音频处于暂停状态,则播放;如果正在播放,则暂停
if (currentAudioInst.paused)
// @ts-expect-error
document.getElementsByClassName('music-player-audio')[0].play();
else
// @ts-expect-error
document.getElementsByClassName('music-player-audio')[0].pause();
});
// 当用户按下PageDown键时触发的事件处理函数,用于播放下一首音频
// @ts-expect-error
useHotkeys('arrowdown', () => window.musicplayer.onPlayNextAudio());
// 当用户按下PageUp键时触发的事件处理函数,用于播放上一首音频
// @ts-expect-error
useHotkeys('arrowup', () => window.musicplayer.onPlayPrevAudio());
// 当用户按下右方向键时触发的事件处理函数,用于音频快进5秒
useHotkeys('arrowright', () => {
if (currentAudioInst === null) return;
currentAudioInst.currentTime += 5;
});
// 当用户按下左方向键时触发的事件处理函数,用于音频后退5秒
useHotkeys('arrowleft', () => {
if (currentAudioInst === null) return;
currentAudioInst.currentTime -= 5;
});
// 当currentAudio的名称发生变化时,更新页面标题
useEffect(() => {
// 如果currentAudio的名称不存在,直接返回
if (!currentAudio?.name) return;
// 更新页面标题为当前音频的名称和应用标题的组合
document.title = `${currentAudio.name} - ${appTitle}`;
}, [currentAudio?.name]);
from azusa-player.
@lovegaoshi 不得不说,你和我的作息tmd正好相反啊
from azusa-player.
Related Issues (20)
- 可以给这个扩展单独挂个代理吗 HOT 6
- 希望可以加个视频合集的列表识别 HOT 1
- 字体缩放问题 HOT 4
- 希望在“搜索歌曲”的结果中删除歌曲后能保持搜索的结果 HOT 9
- 其实完全可以衍生为b站收藏夹
- 希望增加首页、搜索结果页、up主页右键视频链接加入歌单功能 HOT 1
- 希望优化一下随机播放算法 HOT 1
- 能否支持桌面歌词功能 HOT 2
- [Bug] 歌词选择后 收起播放器会重置 HOT 1
- 默认歌单的请求被B站禁止了 HOT 1
- 希望增加“批量添加”的功能
- [Bug]audio error HOT 9
- 添加收藏时如果收藏列表太多会点不了下面的
- 手动修改歌名 HOT 3
- 批量操作收藏夹 HOT 4
- 按键交互问题 HOT 4
- 歌单和设置的导出备份问题 HOT 1
- 歌词出现乱码 HOT 2
- 歌单倒序播放/按时间倒序 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azusa-player.