use of org.prebid.mobile.rendering.models.CreativeVisibilityTracker in project prebid-mobile-android by prebid.
the class VideoCreative method startViewabilityTracker.
@Override
public void startViewabilityTracker() {
VisibilityTrackerOption visibilityTrackerOption = new VisibilityTrackerOption(NativeEventTracker.EventType.IMPRESSION);
mCreativeVisibilityTracker = new CreativeVisibilityTracker(getCreativeView(), visibilityTrackerOption);
mCreativeVisibilityTracker.setVisibilityTrackerListener((result) -> {
if (result.isVisible() && result.shouldFireImpression()) {
mModel.trackVideoEvent(VideoAdEvent.Event.AD_IMPRESSION);
mCreativeVisibilityTracker.stopVisibilityCheck();
mCreativeVisibilityTracker = null;
}
});
mCreativeVisibilityTracker.startVisibilityCheck(mContextReference.get());
}
use of org.prebid.mobile.rendering.models.CreativeVisibilityTracker in project prebid-mobile-android by prebid.
the class VideoView method startVisibilityTracking.
private void startVisibilityTracking() {
stopVisibilityTracking();
final VisibilityTrackerOption visibilityTrackerOption = new VisibilityTrackerOption(NativeEventTracker.EventType.IMPRESSION);
mVisibilityTracker = new CreativeVisibilityTracker(this, visibilityTrackerOption, true);
mVisibilityTracker.setVisibilityTrackerListener(mVisibilityTrackerListener);
mVisibilityTracker.startVisibilityCheck(getContext());
}
Aggregations