startVodPlay method

Future<BoolMsg> startVodPlay(
  1. StringPlayerMsg url
)

通过url开始播放视频 10.7版本开始,startPlay变更为startVodPlay,需要通过 {@link SuperPlayerPlugin#setGlobalLicense} 设置 Licence 后方可成功播放, 否则将播放失败(黑屏),全局仅设置一次即可。直播 Licence、短视频 Licence 和视频播放 Licence 均可使用,若您暂未获取上述 Licence , 可快速免费申请测试版 Licence 以正常播放,正式版 License 需购买 (https://cloud.tencent.com/document/product/881/74588#.E8.B4.AD.E4.B9.B0.E5.B9.B6.E6.96.B0.E5.BB.BA.E6.AD.A3.E5.BC.8F.E7.89.88-license)。

Starting from version 10.7, the method startPlay has been changed to startVodPlay for playing videos via a URL. To play videos successfully, it is necessary to set the license by using the method SuperPlayerPlugin#setGlobalLicense. Failure to set the license will result in video playback failure (a black screen). Live streaming, short video, and video playback licenses can all be used. If you do not have any of the above licenses, you can apply for a free trial license to play videos normallyQuickly apply for a free trial version Licence (https://cloud.tencent.com/act/event/License).Official licenses can be purchased (https://cloud.tencent.com/document/product/881/74588#.E8.B4.AD.E4.B9.B0.E5.B9.B6.E6.96.B0.E5.BB.BA.E6.AD.A3.E5.BC.8F.E7.89.88-license). @param url : 视频播放地址 video playback address return 是否播放成功 if play successfully

Implementation

Future<BoolMsg> startVodPlay(StringPlayerMsg url) async {
  final String pigeonVar_channelName = 'dev.flutter.pigeon.super_player.TXFlutterVodPlayerApi.startVodPlay$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?>[url]) 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 BoolMsg?)!;
  }
}