startPreLoad method

Future<IntMsg> startPreLoad(
  1. PreLoadMsg msg
)

启动预下载。 playUrl: 要预下载的url preloadSizeMB: 预下载的大小(单位:MB) preferredResolution 期望分辨率,long类型,值为高x宽。可参考如720*1080。不支持多分辨率或不需指定时,传-1。 返回值:任务ID,可用这个任务ID停止预下载 stopPreload

Implementation

Future<IntMsg> startPreLoad(PreLoadMsg msg) async {
  final String pigeonVar_channelName = 'dev.flutter.pigeon.super_player.TXFlutterDownloadApi.startPreLoad$pigeonVar_messageChannelSuffix';
  final BasicMessageChannel<Object?> pigeonVar_channel = BasicMessageChannel<Object?>(
    pigeonVar_channelName,
    pigeonChannelCodec,
    binaryMessenger: pigeonVar_binaryMessenger,
  );
  final List<Object?>? pigeonVar_replyList =
      await pigeonVar_channel.send(<Object?>[msg]) as List<Object?>?;
  if (pigeonVar_replyList == null) {
    throw _createConnectionError(pigeonVar_channelName);
  } else if (pigeonVar_replyList.length > 1) {
    throw PlatformException(
      code: pigeonVar_replyList[0]! as String,
      message: pigeonVar_replyList[1] as String?,
      details: pigeonVar_replyList[2],
    );
  } else if (pigeonVar_replyList[0] == null) {
    throw PlatformException(
      code: 'null-error',
      message: 'Host platform returned null value for non-null return value.',
    );
  } else {
    return (pigeonVar_replyList[0] as IntMsg?)!;
  }
}