【发布时间】:2011-03-02 02:09:55
【问题描述】:
我正在尝试在 Android 中加载 YouTube 视频。
我在xml中添加了一个WebView:
<WebView android:id="@+id/VideoView"
android:layout_height="fill_parent"
android:layout_width="fill_parent" />
然后我按如下方式加载它:
WebView webview = new WebView(this);
setContentView(R.layout.webview);
String htmlString = "<html> <body> <embed src=\"http://www.youtube.com/watch?v=XS998HaGk9M\"; type=application/x-shockwave-flash width="+640+" height="+385+"> </embed> </body> </html>";
webview.loadData(htmlString, "text/html", "utf-8");
我已向清单添加了适当的权限。我收到的只是一个空白的白色屏幕,没有任何加载。
有人可以帮我解决这个问题吗?
【问题讨论】: