added seeking to now playing/notification

This commit is contained in:
austinried
2021-08-10 15:27:20 +09:00
parent 9705a95aaa
commit 2d2efe3dcf
7 changed files with 78 additions and 20 deletions

View File

@@ -82,6 +82,12 @@ const createService = async () => {
TrackPlayer.addEventListener(Event.PlaybackMetadataReceived, () => {
setCurrentTrackIdx(useStore.getState().currentTrackIdx)
})
TrackPlayer.addEventListener(Event.RemoteSeek, data => {
trackPlayerCommands.enqueue(async () => {
await TrackPlayer.seekTo(data.position)
})
})
}
module.exports = async function () {