loadRewardVideo static method

void loadRewardVideo(
  1. String posId,
  2. String userId,
  3. dynamic rewardListener(
    1. ZJEvent ret
    ), {
  4. bool videoSoundEnable = true,
  5. String extra = "",
  6. bool isPreLoad = false,
  7. int flags = 0,
})

加载激励视频

Implementation

static void loadRewardVideo(
  /// 广告位ID
  String posId,

  /// 用户ID,必填
  String userId,

  /// 回调。具体事件见 example
  Function(ZJEvent ret) rewardListener, {
  /// 是否开启视频声音
  bool videoSoundEnable = true,

  /// 透传信息(返回到服务端发校验接口)
  String extra = "",

  /// 是否为预加载,默认false
  /// 非预加载时,加载成功后直接播放
  /// 预加载时仅回调成功/失败,需要搭配[showRewardVideo]方法展示
  bool isPreLoad = false,

  /// FLAGS
  int flags = 0,
}) {
  ZJSdkMessageChannel.setRewardVideoListener(rewardListener);
  _sdkMethodChannel.invokeMethod("loadRewardedAd", {
    "posId": posId,
    "userId": userId,
    "extra": extra,
    "videoSoundEnable": videoSoundEnable,
    "isPreLoad": isPreLoad,
    "flags": flags,
  });
}