mediaPlayerLoadResource method

Future<Map> mediaPlayerLoadResource(
  1. int index,
  2. String path,
  3. [int startPosition = 0]
)

Implementation

Future<Map<dynamic, dynamic>> mediaPlayerLoadResource(int index, String path,
    [int startPosition = 0]) async {
  final map = {};
  if (_mediaPlayers[index] == null) {
    map["errorCode"] = MEDIA_PLAYER_NOT_EXIST;
    return Future.value(map);
  }

  final promise = callMethod(
      _mediaPlayers[index].instance, 'loadResource', [path, startPosition]);
  final result = await promiseToFuture(promise);
  map["errorCode"] = getProperty(result, 'errorCode');
  return Future.value(map);
}