void stopOMIDAdSession(){ adWebView.omidAdSession.stopAdSession(); }
@Override public void onAdImpression() { if(!isVideoAd){ omidAdSession.fireImpression(); } }
protected void success() { // Delay creation of AdSession till JS loads completely for WebView Video if(isVideoAd) { omidAdSession.initAdSession(AdWebView.this,isVideoAd); } if (caller_requester != null) { caller_requester.onReceiveAd(getAdResponse()); } }
@SuppressWarnings("deprecation") @SuppressLint("SetJavaScriptEnabled") protected void setup() { setWebChromeClient(new VideoChromeClient(owner)); setWebViewClient(new AdWebViewClient()); omidAdSession = new ANOmidAdSession(); FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); setLayoutParams(params); }
html = prependRawResources(html); html = prependViewPort(html); html = omidAdSession.prependOMIDJSToHTML(html); this.loadDataWithBaseURL(Settings.getBaseUrl(), html, "text/html", "UTF-8", null);
omidAdSession.initAdSession(VideoWebView.this,true); if (paramsDictionary != null) { if (paramsDictionary.has("duration")) {
@SuppressWarnings("deprecation") @SuppressLint("SetJavaScriptEnabled") protected void setup() { implementation = new MRAIDImplementation(this); omidAdSession = new ANOmidAdSession(); setWebChromeClient(mWebChromeClient = new VideoEnabledWebChromeClient(this)); setWebViewClient(new AdWebViewClient()); }
@Override public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); String javascript = "javascript:window.mraid.util.pageFinished()"; if (!firstPageFinished) { injectJavaScript(javascript); if (isMRAIDEnabled) { implementation.webViewFinishedLoading(AdWebView.this, initialMraidStateString); startCheckViewable(); } // Send Back onAdLoaded. For Video Ads it will be sent after we have adReady from player if (isVideoAd && videoImplementation != null) { videoImplementation.webViewFinishedLoading(); } else if (!implementation.isMRAIDTwoPartExpanded) { Clog.i(Clog.baseLogTag, "AdWebView.onPageFinished -- !isMRAIDTwoPartExpanded seding back success"); AdWebView.this.success(); } if(!isVideoAd) { omidAdSession.initAdSession(AdWebView.this,isVideoAd); } firstPageFinished = true; } }
void stopOMIDAdSession(){ omidAdSession.stopAdSession(); }
@Override public void destroy() { if(mWebChromeClient != null){ mWebChromeClient.onHideCustomView(); } omidAdSession.stopAdSession(); // in case `this` was not removed when destroy was called ViewUtil.removeChildFromParent(this); try { super.destroy(); } // Fatal exception in android v4.x in TextToSpeech catch (IllegalArgumentException e) { Clog.e(Clog.baseLogTag, Clog.getString(R.string.apn_webview_failed_to_destroy), e); } this.removeAllViews(); stopCheckViewable(); }