I was able to play youtube video on WebView . I want to end / close / destroy WebView automatically when the YouTube video ends.
here is my code:
WebView engine = new WebView(this); engine.getSettings().setJavaScriptEnabled(true); engine.getSettings().setPluginsEnabled(true); engine.loadUrl("http://www.youtube.com/embed/bIPcobKMB94?autoplay=1&rel=0&loop=0");
Actually, I tried to play songs (audio / video) from the playlist when the sound is in the playlist that it played in my user player, and when you watch the video in WebView format, and the songs play one after the other automatically at the end. Youtube videos play in the WebView , but after the video is completed, the WebView is still open (will not be destroyed / finished). How can I finish the WebView and return to the previous activity?
source share