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();
}
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);
}
}
}
Aggregations