Refactoring
This commit is contained in:
parent
24d97848ee
commit
32d7939761
|
@ -300,7 +300,14 @@ public class AudioPlayer implements MethodCallHandler, Player.EventListener, Met
|
||||||
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));
|
||||||
|
event.add(collectIcyMetadata());
|
||||||
|
|
||||||
|
if (eventSink != null) {
|
||||||
|
eventSink.success(event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private ArrayList<Object> collectIcyMetadata() {
|
||||||
final ArrayList<Object> icyData = new ArrayList<>();
|
final ArrayList<Object> icyData = new ArrayList<>();
|
||||||
final ArrayList<String> info;
|
final ArrayList<String> info;
|
||||||
final ArrayList<Object> headers;
|
final ArrayList<Object> headers;
|
||||||
|
@ -324,11 +331,7 @@ public class AudioPlayer implements MethodCallHandler, Player.EventListener, Met
|
||||||
}
|
}
|
||||||
icyData.add(info);
|
icyData.add(info);
|
||||||
icyData.add(headers);
|
icyData.add(headers);
|
||||||
event.add(icyData);
|
return icyData;
|
||||||
|
|
||||||
if (eventSink != null) {
|
|
||||||
eventSink.success(event);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private long getCurrentPosition() {
|
private long getCurrentPosition() {
|
||||||
|
|
Loading…
Reference in New Issue