Customization

A breakdown of all load-time parameters (autoplay, corner radius, localization, seek behavior, etc.) you can tweak for tailored player behavior.

Adjust player behavior by passing parameters at load time:

  /// Constructor for creating a [TargetVideoPlayer] instance.
  /// All parameters except [playerReference] are optional and nullable.
  TargetVideoPlayer({
    required this.playerReference,
    bool? controlAutoplay,
    bool? scrollOnAd,
    String? creditsLabelColor,
    int? setCornerRadius,
    String? localization,
    int? doubleTapSeek,
    int? seekPreview,
  })  : _controlAutoplay = controlAutoplay,
        _scrollOnAd = scrollOnAd,
        _creditsLabelColor = creditsLabelColor,
        _setCornerRadius = setCornerRadius,
        _localization = localization,
        _doubleTapSeek = doubleTapSeek,
        _seekPreview = seekPreview;

  // Setters for private properties
  /// Sets the [controlAutoplay] property.
  /// This enables the client to take control over autoplay.
  set controlAutoplay(bool? value) {
    _controlAutoplay = value;
  }

  /// Sets the [scrollOnAd] property.
  /// This option enables scrolling during ad and is specific to the iOS platform. By default, Android has scrolling enabled during ads.
  set scrollOnAd(bool? value) {
    _scrollOnAd = value;
  }

  /// Sets the [creditsLabelColor] property.
  /// To achieve color modification for credits label, it is necessary to provide a sequence of six hexadecimal characters, excluding the '#' symbol.
  set creditsLabelColor(String? value) {
    _creditsLabelColor = value;
  }

  /// Sets the [setCornerRadius] property.
  /// This property enables setting the corner radius to the player itself. Its value is in pixels.
  set setCornerRadius(int? value) {
    _setCornerRadius = value;
  }

  /// Sets the [localization] property.
  /// This allows selecting the language in which the player and IMA will operate.
  set localization(String? value) {
    _localization = value;
  }

  /// Sets the [doubleTapSeek] property.
  /// This property set seek seconds for double tap seek player UI.
  set doubleTapSeek(int? value) {
    _doubleTapSeek = value;
  }

  /// Sets the [seekPreview] property.
  /// When set to 1, the feature is enabled and will be visible in all operational modes of the player. When set to 2 the thumbnail image preview during seeking will be available exclusively when the player is in fullscreen mode.
  set seekPreview(int? value) {
    _seekPreview = value;
  }


What’s Next