我尝试播放来自在线音频流网站的在线音频歌曲,如
gaana.com
或
saavn.com
等打开
WebView
.
我的代码:
WebView webView = findViewById(R.id.webView);
webView.setWebViewClient(new WebViewClient());
WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
webView.loadUrl("https://gaana.com/");
网站已正确加载到webview中,但问题是
当我点击播放(任何歌曲)时,什么都不会发生。
i、 e,webview中未显示任何响应。
我的清单文件:
<manifest package="biz.coolpage.aashish.app"
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name="biz.coolpage.aashish.app.MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.Translucent.Light">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<meta-data android:name="android.webkit.WebView.EnableSafeBrowsing"
android:value="true" />
</activity>
</application>
</manifest>
提前感谢大家的帮助。