ContentProgressProvider class

Allow the SDK to track progress of the content video.

Provides updates required to enable triggering ads at configured cue points.

Platform-Specific Features

This class contains an underlying implementation provided by the current platform. Once a platform implementation is imported, the examples below can be followed to use features provided by a platform's implementation.

Below is an example of setting platform-specific creation parameters for iOS and Android:

PlatformContentProgressProviderCreationParams params =
    const PlatformContentProgressProviderCreationParams();

if (InteractiveMediaAdsPlatform.instance is IOSInteractiveMediaAdsPlatform) {
  params = IOSContentProgressProviderCreationParams
      .fromPlatformContentProgressProviderCreationParams(
    params,
  );
} else if (InteractiveMediaAdsPlatform.instance is AndroidInteractiveMediaAdsPlatform) {
  params = AndroidContentProgressProviderCreationParams
      .fromPlatformContentProgressProviderCreationParams(
    params,
  );
}

final ContentProgressProvider provider = ContentProgressProvider.fromPlatformCreationParams(
  params,
);

Below is an example of accessing the platform-specific implementation for iOS and Android:

final ContentProgressProvider provider = ContentProgressProvider();

if (InteractiveMediaAdsPlatform.instance is IOSInteractiveMediaAdsPlatform) {
  final IOSContentProgressProvider iosProvider =
      provider.platform as IOSContentProgressProvider;
} else if (InteractiveMediaAdsPlatform.instance is AndroidInteractiveMediaAdsPlatform) {
  final AndroidContentProgressProvider androidProvider =
      provider.platform as AndroidContentProgressProvider;
}

Constructors

ContentProgressProvider.new()
Constructs an ContentProgressProvider.
ContentProgressProvider.fromPlatform(PlatformContentProgressProvider platform)
Constructs a ContentProgressProvider from a specific platform implementation.
ContentProgressProvider.fromPlatformCreationParams(PlatformContentProgressProviderCreationParams params)
Constructs an ContentProgressProvider from creation params for a specific platform.

Properties

hashCode int
The hash code for this object.
no setterinherited
platform → PlatformContentProgressProvider
Implementation of PlatformContentProgressProvider for the current platform.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setProgress({required Duration progress, required Duration duration}) Future<void>
Sends an update on the progress of the content video.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited