Skip to content

Commit

Permalink
fix: cant play on web
Browse files Browse the repository at this point in the history
  • Loading branch information
little-buddy committed Dec 2, 2023
1 parent 55bc665 commit 64302a1
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/utils/musicControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@ import {
EVENT_SETUP_MENU
} from '@/constants'
import store from '@/store'
import { isElectron } from '@/constants'

export const MusicControllUtils = {
doPlayOrPause() {
const { playing } = store.state['Footer']
ipcRenderer.invoke(EVENT_SETUP_MENU, { playStatus: !playing })
if (isElectron) {
const { playing } = store.state['Footer']
ipcRenderer.invoke(EVENT_SETUP_MENU, { playStatus: !playing })
}
eventBus.emit(EVENT_MUSICCONTROL_PLAY_OR_PAUSE_EMITTER)
},
doPrev() {
Expand All @@ -37,8 +40,12 @@ export const MusicControllUtils = {
// TODO: 再考虑一下
},
doOpenOrCloseLyrics() {
const { visibleFlash } = store.state['Footer']
ipcRenderer.invoke(EVENT_SETUP_MENU, { desktopLyricsStatus: !visibleFlash })
if (isElectron) {
const { visibleFlash } = store.state['Footer']
ipcRenderer.invoke(EVENT_SETUP_MENU, {
desktopLyricsStatus: !visibleFlash
})
}
eventBus.emit(EVENT_MUSICCONTROL_LYRICS_OPEN_OR_CLOSE_EMITTER)
}
}

0 comments on commit 64302a1

Please sign in to comment.