Hitesh Hitesh - 3 years ago 258
Android Question

Play mp3 from mp3 url automatically in Webview android

I have a mp3 url which works perfectly. It also plays the song automatically when opened in Chrome PC version. But when the same link is open in Webview android I need to provided gesture to play.(I have enabled Javascript)

Answer Source

This was done by the function of webview.

 webview.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
 webview.getSettings().setJavaScriptEnabled(true);

Done by try and error. :)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download