mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-04-24 08:07:23 +08:00
播放 空格控制播放 播放进度条
This commit is contained in:
+7
-2
@@ -20,6 +20,7 @@ let state = {
|
||||
text: "hello",
|
||||
},
|
||||
],
|
||||
play: false,
|
||||
isPlay: false,
|
||||
playMusic: {} as SongResult,
|
||||
playMusicUrl: "",
|
||||
@@ -29,13 +30,17 @@ let mutations = {
|
||||
setMenus(state: any, menus: any[]) {
|
||||
state.menus = menus;
|
||||
},
|
||||
setPlay(state: any, playMusic: SongResult) {
|
||||
async setPlay(state: any, playMusic: SongResult) {
|
||||
state.playMusic = playMusic;
|
||||
state.playMusicUrl = getSongUrl(playMusic.id);
|
||||
state.playMusicUrl = await getSongUrl(playMusic.id);
|
||||
state.play = true;
|
||||
},
|
||||
setIsPlay(state: any, isPlay: boolean) {
|
||||
state.isPlay = isPlay;
|
||||
},
|
||||
setPlayMusic(state: any, play: boolean) {
|
||||
state.play = play;
|
||||
},
|
||||
};
|
||||
|
||||
const getSongUrl = async (id: number) => {
|
||||
|
||||
Reference in New Issue
Block a user