currentTrack method
获取当前播放track
TrackType trackInfo 的类型
Implementation
Future<AVPTrackInfo?> currentTrack(TrackType trackIdx) async {
try {
Map<dynamic, dynamic> result = await FlutterAliPlayerFactory.methodChannel
.invokeMethod(
"getCurrentTrack", wrapWithPlayerId(arg: trackIdx.index));
return AVPTrackInfo.fromJson(result);
} on PlatformException catch (e) {
// throw Exception("数据获取异常 ${e.message}");
return null;
}
}