Skip to content

Commit 653d4ef

Browse files
committed
Merge branch 'develop' of github.com:GetStream/stream-chat-react-native into perf/message-list-render-item
2 parents 6b7715e + f8c9b9a commit 653d4ef

File tree

28 files changed

+1075
-340
lines changed

28 files changed

+1075
-340
lines changed

package/expo-package/src/optionalDependencies/Sound.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ class ExpoAudioSoundAdapter {
9999

100100
// eslint-disable-next-line require-await
101101
loadAsync = async (initialStatus) => {
102+
// We have to subscribe as early as possible so that we know the initial status(durarion, etc.) of the audio.
103+
this.subscribeStatusEventListener();
102104
this.initialShouldCorrectPitch = initialStatus.shouldCorrectPitch;
103105
this.initialPitchCorrectionQuality = initialStatus.pitchCorrectionQuality;
104106
};
@@ -136,8 +138,7 @@ class ExpoAudioSoundAdapter {
136138
};
137139

138140
// eslint-disable-next-line require-await
139-
setPositionAsync: SoundReturnType['setPositionAsync'] = async (milliseconds) => {
140-
const seconds = milliseconds / 1000;
141+
setPositionAsync: SoundReturnType['setPositionAsync'] = async (seconds) => {
141142
this.player.seekTo(seconds);
142143
};
143144

package/native-package/src/optionalDependencies/Audio.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ class _Audio {
131131
resumePlayer = async () => {
132132
await audioRecorderPlayer.resumePlayer();
133133
};
134+
seekToPlayer = async (positionInMillis: number) => {
135+
await audioRecorderPlayer.seekToPlayer(positionInMillis);
136+
};
134137
startPlayer = async (uri, _, onPlaybackStatusUpdate) => {
135138
try {
136139
const playback = await audioRecorderPlayer.startPlayer(uri);

0 commit comments

Comments
 (0)