Open ch33kaboo opened 3 months ago
hello @andrewmcgivery , I didn't know there was a simple way to know if the track is playing or not and that's why I introduced a new variable.
Anyway, I fixed the code by using if(this.localPlayerStateObservable.getValue().playerState === PLAYER_STATE.PLAYING)
as you mentioned, I tested it and it works all fine. 👍👍
This is the implementation of the feature request #35 (I opened few hours earlier). Adding commands to the plugin is useful because the user can control their playback without touching the mouse, they can use the command palette or assign hotkeys (keyboard shortcuts) to the commands. Here is a breakdown of the changes:
this.addCommand({})
for three different commands (play next track, play previous track, and toggle play/pause)this.next()
andthis.previous()
respectivelyI tested the changes and they all work fine![image](https://github.com/andrewmcgivery/obsidian-soundscapes/assets/100171494/c20f778b-9967-411f-afe7-27b87027b3c8)