mirror of
https://github.com/austinried/subtracks.git
synced 2025-12-29 17:39:27 +01:00
Merge branch 'main' of github.com:austinried/subtracks into main
This commit is contained in:
commit
4905f75564
@ -28,9 +28,9 @@ const setNetState = (netState: 'mobile' | 'wifi') => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const rebuildQueue = () => {
|
const rebuildQueue = (forcePlay?: boolean) => {
|
||||||
unstable_batchedUpdates(() => {
|
unstable_batchedUpdates(() => {
|
||||||
useStore.getState().rebuildQueue(useStore.getState().playerState === State.Playing)
|
useStore.getState().rebuildQueue(forcePlay)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,7 +139,7 @@ const createService = async () => {
|
|||||||
|
|
||||||
// fix for ExoPlayer aborting playback while esimating content length
|
// fix for ExoPlayer aborting playback while esimating content length
|
||||||
if (code === 'playback-source' && message.includes('416')) {
|
if (code === 'playback-source' && message.includes('416')) {
|
||||||
rebuildQueue()
|
rebuildQueue(true)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -274,6 +274,7 @@ export const createTrackPlayerSlice = (set: SetStore, get: GetStore): TrackPlaye
|
|||||||
const currentTrack = await getCurrentTrack()
|
const currentTrack = await getCurrentTrack()
|
||||||
const playerState = await getPlayerState()
|
const playerState = await getPlayerState()
|
||||||
const position = (await TrackPlayer.getPosition()) || 0
|
const position = (await TrackPlayer.getPosition()) || 0
|
||||||
|
const repeatMode = await getRepeatMode()
|
||||||
|
|
||||||
const queueName = get().queueName
|
const queueName = get().queueName
|
||||||
const queueContextId = get().queueContextId
|
const queueContextId = get().queueContextId
|
||||||
@ -304,6 +305,7 @@ export const createTrackPlayerSlice = (set: SetStore, get: GetStore): TrackPlaye
|
|||||||
await TrackPlayer.skip(currentTrack)
|
await TrackPlayer.skip(currentTrack)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await TrackPlayer.setRepeatMode(repeatMode)
|
||||||
await TrackPlayer.seekTo(position)
|
await TrackPlayer.seekTo(position)
|
||||||
|
|
||||||
if (playerState === State.Playing || forcePlay) {
|
if (playerState === State.Playing || forcePlay) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user