【发布时间】:2022-04-12 07:07:17
【问题描述】:
我尝试在WebView 上播放来自gaana.com 或saavn.com 等在线音频流媒体网站的在线音频歌曲。
我的代码:
WebView webView = findViewById(R.id.webView);
webView.setWebViewClient(new WebViewClient());
WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
webView.loadUrl("https://gaana.com/");
网站已正确加载到 webview 中,但问题是 当我点击播放(任何歌曲)时,什么都不会发生。 即 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>
提前感谢大家的帮助。
【问题讨论】:
-
可以提供manifest文件吗?
-
@MeosCoder 我添加了有问题的清单文件。
标签: android webview audio-streaming