File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -105,12 +105,9 @@ export const AudioAttachment = (props: AudioAttachmentProps) => {
105105
106106 const handleEnd = async ( ) => {
107107 setAudioFinished ( false ) ;
108- // The order is important here. We need to seek to 0 before pausing the audio.
109- await seekAudio ( 0 ) ;
110- if ( isExpoCLI ) {
111- await pauseAudio ( ) ;
112- }
108+ await pauseAudio ( ) ;
113109 onPlayPause ( item . id , true ) ;
110+ await seekAudio ( 0 ) ;
114111 } ;
115112
116113 const dragStart = async ( ) => {
@@ -159,7 +156,9 @@ export const AudioAttachment = (props: AudioAttachmentProps) => {
159156 onProgress ( item . id , positionMillis / ( item . duration * 1000 ) ) ;
160157 }
161158 } else {
162- onProgress ( item . id , positionMillis / durationMillis ) ;
159+ if ( positionMillis <= durationMillis ) {
160+ onProgress ( item . id , positionMillis / durationMillis ) ;
161+ }
163162 }
164163 } else {
165164 // Update your UI for the paused state
@@ -185,7 +184,9 @@ export const AudioAttachment = (props: AudioAttachmentProps) => {
185184 if ( item && item . file && item . file . uri ) {
186185 soundRef . current = await Sound . initializeSound (
187186 { uri : item . file . uri } ,
188- { } ,
187+ {
188+ progressUpdateIntervalMillis : 100 ,
189+ } ,
189190 onPlaybackStatusUpdate ,
190191 ) ;
191192 }
Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ const styles = StyleSheet.create({
191191 borderRadius : 5 ,
192192 borderWidth : 0.2 ,
193193 elevation : 6 ,
194- height : 25 ,
194+ height : 28 ,
195195 shadowOffset : {
196196 height : 3 ,
197197 width : 0 ,
You can’t perform that action at this time.
0 commit comments