Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
Update audio player class in mobile to match the type and make small …
Browse files Browse the repository at this point in the history
…update to playback rate saga
  • Loading branch information
Kyle-Shanks committed Feb 16, 2023
1 parent 07c24e0 commit 3389ffa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@ export class NativeMobileAudio {
stop = () => {}
seek = () => {}
setVolume = () => null
// TODO: Need to fix this so that it actually works
setPlaybackRate = () => null
isBuffering = () => false
getPosition = async () => 0
getDuration = () => 0
// TODO: Need to fix this so that it actually works
getPlaybackRate = () => '1x'
// TODO: Need to fix this so that it actually works
getAudioPlaybackRate = () => 1.0
onBufferingChange = () => {}
onError = () => {}
}
2 changes: 1 addition & 1 deletion packages/web/src/common/store/player/sagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,11 @@ export function* watchSeek() {
}

export function* watchSetPlaybackRate() {
const audioPlayer = yield* getContext('audioPlayer')
yield* takeLatest(
setPlaybackRate.type,
function* (action: ReturnType<typeof setPlaybackRate>) {
const { rate } = action.payload
const audioPlayer = yield* getContext('audioPlayer')
audioPlayer.setPlaybackRate(rate)
}
)
Expand Down

0 comments on commit 3389ffa

Please sign in to comment.