React-native-sound: How about using RCTEventEmitter for "getCurrentTime"?

Created on 20 Sep 2017  路  3Comments  路  Source: zmxv/react-native-sound

I think better using "RCTEventEmitter" than 'setInterval' when we use "getCurrentTime".
What do you think about it?

Most helpful comment

Perhaps in Android this can be implemented as a TimerTask that keeps checking on the player.getCurrentPosition.
This way the experience is consistent across OS.

All 3 comments

That would be nice, and I think it would be possible for iOS, but not for Android. Android's MediaPlayer doesn't support a way to observe changes in current time.

So we have to decide if we want to support this for iOS and not for Android, what do you think @trepidity? And it would be something for a future release I think, if we decide to support this.

My first thought is no. Features that do not have parity across all systems is contrary React/React-Native.

Does adding this feature make implementation for the first-timer easier or harder?
I could see adding it as an "advanced" or undocumented API feature.

Perhaps in Android this can be implemented as a TimerTask that keeps checking on the player.getCurrentPosition.
This way the experience is consistent across OS.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ya-watanabe picture ya-watanabe  路  4Comments

nfq6612 picture nfq6612  路  3Comments

poc7667 picture poc7667  路  4Comments

leannaweller picture leannaweller  路  5Comments

Jeremaiha picture Jeremaiha  路  5Comments