Call getDuration() after loading on Android.
This commit is contained in:
parent
3b874d92f3
commit
7e22618466
|
@ -203,10 +203,9 @@ public class AudioPlayer implements MethodCallHandler, Player.EventListener, Aud
|
||||||
switch (playbackState) {
|
switch (playbackState) {
|
||||||
case Player.STATE_READY:
|
case Player.STATE_READY:
|
||||||
if (prepareResult != null) {
|
if (prepareResult != null) {
|
||||||
long duration = getDuration();
|
|
||||||
transition(ProcessingState.ready);
|
transition(ProcessingState.ready);
|
||||||
Map<String, Object> response = new HashMap<>();
|
Map<String, Object> response = new HashMap<>();
|
||||||
response.put("duration", 1000 * duration);
|
response.put("duration", 1000 * getDuration());
|
||||||
prepareResult.success(response);
|
prepareResult.success(response);
|
||||||
prepareResult = null;
|
prepareResult = null;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue