Search in sources :

Example 1 with CreativeVisibilityTracker

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());
}
Also used : CreativeVisibilityTracker(org.prebid.mobile.rendering.models.CreativeVisibilityTracker) VisibilityTrackerOption(org.prebid.mobile.rendering.models.internal.VisibilityTrackerOption)

Example 2 with CreativeVisibilityTracker

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());
}
Also used : CreativeVisibilityTracker(org.prebid.mobile.rendering.models.CreativeVisibilityTracker) VisibilityTrackerOption(org.prebid.mobile.rendering.models.internal.VisibilityTrackerOption)

Aggregations

CreativeVisibilityTracker (org.prebid.mobile.rendering.models.CreativeVisibilityTracker)2 VisibilityTrackerOption (org.prebid.mobile.rendering.models.internal.VisibilityTrackerOption)2