2017-09-16 105 views
0

我想在WebView中播放直播电视。 WebView在页面中显示黑屏直播流区域,但不会加载和播放流。在webview(安卓)流媒体

wv.setWebChromeClient(new WebChromeClient());(mainactivity)

安卓硬件加速= “真”(manifest.xml文件)不工作

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://www.fox.com.tr/canli-yayin"); 
wv.setWebViewClient(new WebViewClient()); 

回答

0

所有直播不Mobile.So首先检查支持无论您的网址是否在Chrome浏览器中运行。如果它在工作,那么你可以使用自定义标签

compile 'com.android.support:customtabs:23.3.0' 

String url = ¨http://www.fox.com.tr/canli-yayin¨; 
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder(); 
CustomTabsIntent customTabsIntent = builder.build(); 
customTabsIntent.launchUrl(this, Uri.parse(url));