gpt4 book ai didi

java - 如何使用 loadDataWithBaseURL 播放嵌入视频

转载 作者:行者123 更新时间:2023-11-29 21:46:55 27 4
gpt4 key购买 nike

问题描述

我正在尝试通过调用 loadDataWithBaseURL 方法并向其传递嵌入数据来播放 SWF 视频。但是视频没有开始播放,只是显示白屏。我做错了什么吗?

源代码

protected void onCreate(Bundle savedInstanceState) {
// Get Web View from the layout.
mWebView = (WebView) findViewById(R.id.webViewOnlieWebCams);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setPluginsEnabled(true);
mWebView.getSettings().setAllowFileAccess(true);

String mimeType = "text/html";
String encoding = "utf-8";
String embed = "<embed type=\"application/x-shockwave-flash\" src=\"/bundles/mymain/swf/player-licensed.swf\" width=\"320\" height=\"390\" style=\"undefined\" id=\"mpl\" name=\"mpl\" quality=\"low\" allowfullscreen=\"true\" allowscriptaccess=\"always\" wmode=\"opaque\" flashvars=\"autostart=true&amp;file=camera39.stream&amp;streamer=rtmp://wss.yerevan.am/axis&amp;logo=/bundles/mymain/images/logo10.png&amp;logo.hide=false&amp;logo.position=bottom-left&amp;logo.timeout=3\">";

mWebView.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, "");

关于java - 如何使用 loadDataWithBaseURL 播放嵌入视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15543142/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com