android:在webview中播放youtube视频时出现问题

时间:2013-05-16 08:43:29

标签: android webview youtube

我的播放视频的代码如下。在onlt HTC手机上,我收到了错误

“网页不可用

网页数据:text / html;%20charset = UTF-8; null,%3Chtml%3E%3Chead%3E%3C / head%3E%3Cbody%20style =%22margin:%200;% 20padding:%200%22%3E%3Ciframe%20type =%22text / HTML%22%20class =%22youtube玩家%22%20width =%22300%22%20height =%22100 %% 22%20src =%22http

它正在使用其他设备。

为什么视频链接不适用于此设备而其他设备正确排列 还是其他一些问题。请帮忙

String data = "<html>"
                + "<head>"
                + "</head>"
                + "<body style=\"margin: 0; padding: 0\">"
                + "<iframe "
                + "type=\"text/html\" "
                + "class=\"youtube-player\" "
                + "width=\""
                + width
                + "\" "
                + "height=\""
                + height
                + "\" "
                + "src=\"http://www.youtube.com/v/"
                + videoid
                + "?controls=0&showinfo=0&showsearch=0&modestbranding=1&autoplay=1&fs=0\" "
                + "frameborder=\"0\"></iframe>" + "</body>" + "</html>";

webReview.loadData(data,
                        "text/html; charset=UTF-8", null);

0 个答案:

没有答案