mediaPlayerLoadResourceFromMediaData method
Future<Map>
mediaPlayerLoadResourceFromMediaData(
- int index,
- dynamic mediaData,
- int startPosition
)
Implementation
Future<Map<dynamic, dynamic>> mediaPlayerLoadResourceFromMediaData(
int index, dynamic mediaData, int startPosition) async {
final map = {};
if (_mediaPlayers[index] == null) {
map["errorCode"] = 1;
return Future.value(map);
}
await (() {
Map completerMap = createCompleter();
_mediaPlayers[index].instance.loadResourceFromMediaData(mediaData,
startPosition, completerMap["success"], completerMap["fail"]);
return completerMap["completer"].future;
})();
map["errorCode"] = 0;
return Future.value(map);
}