@Override public boolean isMediated() { // Only SSM / RTBHTML and BannerVideo use AdWebView for rendering return (UTConstants.SSM.equalsIgnoreCase(adResponseData.getContentSource())) ? true : false; }
protected BaseAdResponse popAd() { if ((adList != null) && (adList.getFirst() != null)) { if (adList.getFirst().getContentSource() != null && adList.getFirst().getContentSource().equalsIgnoreCase("csm")){ CSMSDKAdResponse CSMSDKAdResponse = (CSMSDKAdResponse)adList.getFirst(); mediatedClasses.add(CSMSDKAdResponse.getClassName()); } return adList.removeFirst(); } return null; }
private void processNextAd() { // If we're about to dispatch a creative to a banner // that has been resized by ad stretching, reset its size VideoAd owner = this.owner.get(); if (getAdList() != null && !getAdList().isEmpty()) { BaseAdResponse baseAdResponse = popAd(); if (baseAdResponse.getContentSource().equalsIgnoreCase(UTConstants.RTB)) { handleRTBResponse(owner, (RTBVASTAdResponse) baseAdResponse); } else if (baseAdResponse.getContentSource().equalsIgnoreCase(UTConstants.CSM_VIDEO)) { handleCSMVASTAdResponse(owner, (CSMVASTAdResponse) baseAdResponse); } } }
private void processNextAd() { // If we're about to dispatch a creative to a banner // that has been resized by ad stretching, reset its size Ad owner = null; owner = this.owner.get(); if ((owner != null) && getAdList() != null && !getAdList().isEmpty()) { final BaseAdResponse baseAdResponse = popAd(); if (UTConstants.RTB.equalsIgnoreCase(baseAdResponse.getContentSource())) { handleRTBResponse(owner, baseAdResponse); } else if (UTConstants.CSM.equalsIgnoreCase(baseAdResponse.getContentSource())) { handleCSMResponse(owner, (CSMSDKAdResponse) baseAdResponse); } else if (UTConstants.SSM.equalsIgnoreCase(baseAdResponse.getContentSource())) { handleSSMResponse((AdView) owner, (SSMHTMLAdResponse) baseAdResponse); } else { Clog.e(Clog.baseLogTag, "processNextAd failed:: invalid content source:: " + baseAdResponse.getContentSource()); continueWaterfall(ResultCode.INTERNAL_ERROR); } } }
@Override public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); Clog.d(Clog.videoLogTag, "onPageFinished"); if (!firstPageLoadComplete) { firstPageLoadComplete = true; setOMIDPartner(); if (baseAdResponse.getContentSource().equalsIgnoreCase(UTConstants.CSM_VIDEO)) { processMediationAd(); } else { createVastPlayerWithContent(); } } }
private void initiateVastAdView(final VideoAd owner, final BaseAdResponse response) { Clog.d(Clog.videoLogTag, "Creating WebView for::" + response.getContentSource()); VideoWebView adVideoView = new VideoWebView(owner.getContext(), owner, this); owner.getVideoAdView().setVideoWebView(adVideoView); adVideoView.loadAd(response); }
/** * Tests rtb banner response * * @throws Exception */ @Test public void testBannerResponse() throws Exception { String bannerString = TestResponsesUT.banner(); utAdResponse = new UTAdResponse(bannerString, null, MediaType.BANNER, "v"); assertNotNull(utAdResponse); LinkedList<BaseAdResponse> list = utAdResponse.getAdList(); assertNotNull(utAdResponse.getAdList()); while (!list.isEmpty()) { BaseAdResponse baseAdResponse = (BaseAdResponse) list.removeFirst(); assertEquals("rtb", baseAdResponse.getContentSource()); assertEquals("6332753", baseAdResponse.getCreativeId()); } }
/** * Tests csm & rtb banner response * * @throws Exception */ @Test public void testBannerCSMResponse() throws Exception { String bannerCSMString = TestResponsesUT.noFillCSM_RTBBanner(); utAdResponse = new UTAdResponse(bannerCSMString, null, MediaType.BANNER, "v"); assertNotNull(utAdResponse); LinkedList<BaseAdResponse> list = utAdResponse.getAdList(); assertNotNull(utAdResponse.getAdList()); System.out.println("Printing first"); CSMSDKAdResponse baseCSMSDKAdResponse = (CSMSDKAdResponse) list.getFirst(); assertEquals("csm", baseCSMSDKAdResponse.getContentSource()); assertEquals("44863345", baseCSMSDKAdResponse.getCreativeId()); System.out.println("Printing second"); BaseAdResponse baseAdResponse = (BaseAdResponse) list.getLast(); assertEquals("rtb", baseAdResponse.getContentSource()); assertEquals("6332753", baseAdResponse.getCreativeId()); }
setCreativeHeight(ad.getDisplayable().getCreativeHeight()); setCreativeId(ad.getResponseData().getCreativeId()); if (ad.isMediated() && ad.getResponseData().getContentSource() == UTConstants.CSM) { try { displayMediated((MediatedDisplayable) ad.getDisplayable());