Search in sources :

Example 6 with VideoCreative

use of org.prebid.mobile.rendering.video.VideoCreative in project prebid-mobile-android by prebid.

the class InterstitialManagerTest method displayViewAsInterstitialSuccess_ShowInterstitialAdView.

@Test
@LooperMode(LooperMode.Mode.PAUSED)
public void displayViewAsInterstitialSuccess_ShowInterstitialAdView() {
    VideoCreative mockVideoCreative = mock(VideoCreative.class);
    when(mockVideoCreative.isResolved()).thenReturn(true);
    BaseJSInterface mockJsInterface = mock(BaseJSInterface.class);
    when(mockJsInterface.getJsExecutor()).thenReturn(mock(JsExecutor.class));
    WebViewBase mockWebViewBase = mock(WebViewBase.class);
    when(mockWebViewBase.getMRAIDInterface()).thenReturn(mockJsInterface);
    PrebidWebViewInterstitial mockPrebidWebViewInterstitial = mock(PrebidWebViewInterstitial.class);
    when(mockPrebidWebViewInterstitial.getWebView()).thenReturn(mockWebViewBase);
    InterstitialView mockInterstitialView = mock(InterstitialView.class);
    when(mockInterstitialView.getCreativeView()).thenReturn(mockPrebidWebViewInterstitial);
    mSpyInterstitialManager.displayAdViewInInterstitial(mContext, mockInterstitialView);
    verify(mMockAdViewDelegate).showInterstitial();
}
Also used : BaseJSInterface(org.prebid.mobile.rendering.views.webview.mraid.BaseJSInterface) PrebidWebViewInterstitial(org.prebid.mobile.rendering.views.webview.PrebidWebViewInterstitial) VideoCreative(org.prebid.mobile.rendering.video.VideoCreative) JsExecutor(org.prebid.mobile.rendering.views.webview.mraid.JsExecutor) WebViewBase(org.prebid.mobile.rendering.views.webview.WebViewBase) InterstitialView(org.prebid.mobile.rendering.bidding.display.InterstitialView) Test(org.junit.Test) LooperMode(org.robolectric.annotation.LooperMode)

Example 7 with VideoCreative

use of org.prebid.mobile.rendering.video.VideoCreative in project prebid-mobile-android by prebid.

the class AdViewManager method returnFromVideo.

public void returnFromVideo(View callingView) {
    if (mCurrentCreative != null && mCurrentCreative.isBuiltInVideo()) {
        View creativeView = mCurrentCreative.getCreativeView();
        if (creativeView instanceof VideoCreativeView && mCurrentCreative.isVideo()) {
            VideoCreativeView videoCreativeView = (VideoCreativeView) creativeView;
            VideoCreative videoCreative = (VideoCreative) mCurrentCreative;
            videoCreativeView.hideCallToAction();
            videoCreativeView.mute();
            videoCreative.updateAdView(callingView);
            videoCreative.onPlayerStateChanged(InternalPlayerState.NORMAL);
        }
    }
}
Also used : VideoCreative(org.prebid.mobile.rendering.video.VideoCreative) InterstitialView(org.prebid.mobile.rendering.bidding.display.InterstitialView) View(android.view.View) VideoCreativeView(org.prebid.mobile.rendering.video.VideoCreativeView) VideoCreativeView(org.prebid.mobile.rendering.video.VideoCreativeView)

Aggregations

VideoCreative (org.prebid.mobile.rendering.video.VideoCreative)7 Test (org.junit.Test)5 VideoCreativeModel (org.prebid.mobile.rendering.video.VideoCreativeModel)4 ArrayList (java.util.ArrayList)2 InterstitialView (org.prebid.mobile.rendering.bidding.display.InterstitialView)2 AdConfiguration (org.prebid.mobile.rendering.models.AdConfiguration)2 VideoAdEvent (org.prebid.mobile.rendering.video.VideoAdEvent)2 Handler (android.os.Handler)1 View (android.view.View)1 HashMap (java.util.HashMap)1 InvocationOnMock (org.mockito.invocation.InvocationOnMock)1 AdException (org.prebid.mobile.rendering.errors.AdException)1 CreativeFactory (org.prebid.mobile.rendering.loading.CreativeFactory)1 Transaction (org.prebid.mobile.rendering.loading.Transaction)1 TransactionManager (org.prebid.mobile.rendering.loading.TransactionManager)1 AbstractCreative (org.prebid.mobile.rendering.models.AbstractCreative)1 RewardedVideoCreative (org.prebid.mobile.rendering.video.RewardedVideoCreative)1 VideoCreativeView (org.prebid.mobile.rendering.video.VideoCreativeView)1 PrebidWebViewInterstitial (org.prebid.mobile.rendering.views.webview.PrebidWebViewInterstitial)1 WebViewBase (org.prebid.mobile.rendering.views.webview.WebViewBase)1