How to detect if your clicked youtube play button inside of webview in android java?

Viewed 141

I have directly loaded the url https://youtube.com inside webview of my android app. There is an existing banner ads. I need to hide admob banner ads when video is playing and show when not playing. I am not using any API's to show youtube videos, instead i directly loaded youtube.com url into the webview. In this situation how to detect used tapped play button and pause button so that i can show hide admob banner ads into my application.

Thanks.

1 Answers

It seems impossible to detect it without complex codes. I solved the problem by not displaying banner ads inside the fragment webview. Instead i displayed interstitial ads before navigating to the fragment where there is webview.

Related