playWithAds method

Future<void> playWithAds({
  1. required String url,
  2. required String adsUrl,
  3. int countDown = 15,
  4. String? landingUrl,
  5. Map<String, String>? headers,
})

Play with a pre-roll ad video before the main content. landingUrl is opened when the user taps "了解详情" on the ad overlay.

Implementation

Future<void> playWithAds({
  required String url,
  required String adsUrl,
  int countDown = 15,
  String? landingUrl,
  Map<String, String>? headers,
}) =>
    _invoke('playWithAds', {
      'url': url,
      'adsUrl': adsUrl,
      'countDown': countDown,
      if (landingUrl != null && landingUrl.isNotEmpty)
        'landingUrl': landingUrl,
      if (headers != null) 'headers': headers,
    });