Class VideoPlayerViewableTracker
-
- All Implemented Interfaces:
-
com.inmobi.media.ads.common.viewability.ViewabilityManager
public final class VideoPlayerViewableTracker implements ViewabilityManager<Boolean>
Tracks the viewability of a video player view to determine when video should play or pause.
This class implements ViewabilityManager to provide viewability tracking specifically for video players. It monitors when a video view meets the required visibility criteria (percentage visible, minimum dimensions) and reports viewability status as a boolean flow that can be used to control video playback.
-
-
Constructor Summary
Constructors Constructor Description VideoPlayerViewableTracker(CoroutineScope coroutineScope, View trackingView, ViewableTrackerConfig config)
-
Method Summary
-
-
Constructor Detail
-
VideoPlayerViewableTracker
VideoPlayerViewableTracker(CoroutineScope coroutineScope, View trackingView, ViewableTrackerConfig config)
-
-
Method Detail
-
startTracking
Flow<Boolean> startTracking()
Starts tracking viewability and returns a Flow of boolean values.
The returned Flow emits true when the video view is viewable (meets the configured visibility criteria) and false when it is not viewable.
- Returns:
Flow<Boolean> emitting viewability status
-
pause
Unit pause()
Pauses viewability tracking.
This temporarily stops the tracking process without releasing resources, allowing it to be resumed later.
-
resume
Unit resume()
Resumes viewability tracking.
This restarts the tracking process after it has been paused.
-
-
-
-