Fix NullPointerException on eventSink
This commit is contained in:
parent
8d15a6c65c
commit
7911f2010f
|
@ -228,8 +228,10 @@ public class AudioPlayer implements MethodCallHandler, Player.EventListener {
|
||||||
event.add(updatePosition = getCurrentPosition());
|
event.add(updatePosition = getCurrentPosition());
|
||||||
event.add(updateTime = System.currentTimeMillis());
|
event.add(updateTime = System.currentTimeMillis());
|
||||||
event.add(Math.max(updatePosition, bufferedPosition));
|
event.add(Math.max(updatePosition, bufferedPosition));
|
||||||
|
if (eventSink != null) {
|
||||||
eventSink.success(event);
|
eventSink.success(event);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private long getCurrentPosition() {
|
private long getCurrentPosition() {
|
||||||
if (state == PlaybackState.none || state == PlaybackState.connecting) {
|
if (state == PlaybackState.none || state == PlaybackState.connecting) {
|
||||||
|
|
Loading…
Reference in New Issue