Call getDuration() after loading on Android.

This commit is contained in:
Ryan Heise 2020-10-16 13:19:29 +11:00
parent 3b874d92f3
commit 7e22618466
1 changed files with 1 additions and 2 deletions

View File

@ -203,10 +203,9 @@ public class AudioPlayer implements MethodCallHandler, Player.EventListener, Aud
switch (playbackState) {
case Player.STATE_READY:
if (prepareResult != null) {
long duration = getDuration();
transition(ProcessingState.ready);
Map<String, Object> response = new HashMap<>();
response.put("duration", 1000 * duration);
response.put("duration", 1000 * getDuration());
prepareResult.success(response);
prepareResult = null;
} else {