视频显示嵌入式视频



在我的应用程序中,我以格式从 web服务获取数据

例如

<iframe width="560" height="315" src="https://www.youtube.com/embed/S3HZP9rOWwk?rel=0&showinfo=0" frameborder="0" allowfullscreen></iframe>

iframe的来源可能会根据不同的提供商的不同而有所不同我的问题是,如何让我的申请显示来自不同来源的视频,或者有任何库的库来统一的视频加载?

就这样做。

WebView wv = (WebView) findViewById(R.id.webView);
WebSettings ws = wv.getSettings();
ws.setJavaScriptEnabled(true);
wv.loadData(videourl, "text/html; charset=utf-8", "UTF-8");

例如

 wv.loadData("<iframe width="560" height="315" src="https://www.youtube.com/embed/S3HZP9rOWwk?rel=0&showinfo=0" frameborder="0" allowfullscreen></iframe>", "text/html; charset=utf-8", "UTF-8");

最新更新