Java 如何使用loadDataWithBaseURL播放嵌入视频 问题描述
我试图通过调用loadDataWithBaseURL方法并向其传递嵌入数据来播放SWF视频。但视频并没有开始播放,只是显示白色屏幕。我做错什么了吗 源代码Java 如何使用loadDataWithBaseURL播放嵌入视频 问题描述,java,android,video,video-streaming,Java,Android,Video,Video Streaming,我试图通过调用loadDataWithBaseURL方法并向其传递嵌入数据来播放SWF视频。但视频并没有开始播放,只是显示白色屏幕。我做错什么了吗 源代码 创建时受保护的void(Bundle savedInstanceState){ //从布局中获取Web视图。 mWebView=(WebView)findViewById(R.id.webViewOnlieWebCams); mWebView.getSettings().setJavaScriptEnabled(true); mWebView
创建时受保护的void(Bundle savedInstanceState){
//从布局中获取Web视图。
mWebView=(WebView)findViewById(R.id.webViewOnlieWebCams);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setPluginsEnabled(true);
mWebView.getSettings().setAllowFileAccess(true);
字符串mimeType=“text/html”;
字符串编码=“utf-8”;
字符串嵌入=”;
loadDataWithBaseURL(null,embed,mimeType,encoding,“”);
}
尝试以下代码:
String html = "<object width=\"1008\"height=\"550\"> <param name=\"movie\" value=\"file://"
+ path
+ "\"> <embed src=\"file://"
+ path
+ "\" width=\"1008\"height=550\"> </embed> </object>";
String mimeType = "text/html";
String encoding = "utf-8";
web.loadDataWithBaseURL("null", html, mimeType, encoding, "");
stringhtml=”
String html = "<object width=\"1008\"height=\"550\"> <param name=\"movie\" value=\"file://"
+ path
+ "\"> <embed src=\"file://"
+ path
+ "\" width=\"1008\"height=550\"> </embed> </object>";
String mimeType = "text/html";
String encoding = "utf-8";
web.loadDataWithBaseURL("null", html, mimeType, encoding, "");