hyochan / react-native-audio-recorder-player

react-native native module for audio recorder and player.
MIT License
681 stars 203 forks source link

fix(ios): currentPosition and duration may never equal during playing #570

Closed Phecda closed 8 months ago

Phecda commented 8 months ago

Problem

When play a remote file on iOS, currentPosition may never get to duration, which makes it difficult to know whether the playing is end.

Solution

Add an observer to native player end event, and in that observer, force trigger another playback event, where currentPosition is set to be duration. Note that at this moment, playerItem.currentTime is still smaller than duration, so we cannot use that value.

may fix #328

shahid-vorksol commented 8 months ago

same issue on android...