Java 直播电视或视频流不';无法在Webview(Android)中播放
我正在尝试在网络视图中播放直播电视。WebView在页面中显示了一个黑屏livestream区域,但它没有加载和播放流 我在Java 直播电视或视频流不';无法在Webview(Android)中播放,java,android,webview,Java,Android,Webview,我正在尝试在网络视图中播放直播电视。WebView在页面中显示了一个黑屏livestream区域,但它没有加载和播放流 我在manifest.xml中添加了android:hardwareAccelerated=“true”。这是我的代码: Context context = MainActivity.this; SharedPreferences sharedPreferences; boolean isAppInstalled = false; CookieManager.getInsta
manifest.xml
中添加了android:hardwareAccelerated=“true”
。这是我的代码:
Context context = MainActivity.this;
SharedPreferences sharedPreferences;
boolean isAppInstalled = false;
CookieManager.getInstance().setAcceptCookie(true);
CookieSyncManager.createInstance(this);
CookieSyncManager.getInstance().startSync();
sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
isAppInstalled= sharedPreferences.getBoolean("isAppInstalled", false);
if (isAppInstalled==false) {
Intent intent1 = new Intent(getApplicationContext(), MainActivity.class);
intent1.setAction(Intent.ACTION_MAIN);
Intent intent2 = new Intent();
intent2.putExtra(Intent.EXTRA_SHORTCUT_INTENT, intent1);
intent2.putExtra(Intent.EXTRA_SHORTCUT_NAME, "EXAM");
intent2.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, Intent.ShortcutIconResource.fromContext(getApplicationContext(), R.drawable.ic_launcher));
intent2.setAction("com.android.launcher.action.INSTALL_SHORTCUT");
getApplicationContext().sendBroadcast(intent2);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putBoolean("isAppInstalled", true);
editor.commit();
}
wv = (WebView) findViewById(R.id.wv);
wv.setWebChromeClient(new WebChromeClient());
wv.getSettings().setPluginState(WebSettings.PluginState.ON);
wv.getSettings().setJavaScriptEnabled(true);
wv.setFocusable(true);
wv.setFocusableInTouchMode(true);
wv.getSettings().setRenderPriority(WebSettings.RenderPriority.HIGH);
wv.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
wv.getSettings().setDomStorageEnabled(true);
wv.getSettings().setDomStorageEnabled(true);
wv.getSettings().setAppCacheEnabled(true);
wv.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
wv.loadUrl("http://exam_URL.com");
wv.setWebViewClient(new WebViewClient());
日志中是否显示错误?应用程序正在模拟器和手机上运行。我没有错。webview-检查,快捷方式图标-检查,cookie管理器-检查。。。。考试URL正在打开,但我在考试URL中单击了视频链接(exam.tv)。正在加载exam.tv页面,但未进行流式处理。日志中是否显示错误?应用程序正在模拟器和手机上运行。我没有错。webview-检查,快捷方式图标-检查,cookie管理器-检查。。。。考试URL正在打开,但我在考试URL中单击了视频链接(exam.tv)。正在加载exam.tv页面,但未进行流式处理。