本文介绍了YouTube的视频嵌入在Android中4+不工作(冰淇淋三明治,果冻豆)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这code工作在Android精品2.2.But在Android中给协议不支持错误4+
我所指向这个网站
< HTML和GT;
< HEAD>
< META NAME =视口CONTENT =WIDTH =设备的宽度,高度=设备的高度;>
<标题> Vadivel< /标题><风格>
身体
{
背景颜色:#588DEA;
}
< /风格>
< /头>
<车身MARGINWIDTH =0MARGINHEIGHT =0>&所述;对象宽度=320HEIGHT =430>
&LT; PARAM NAME =电影 value=\"https://www.youtube.com/v/5whBYQVnjvY?modestbranding=1&rel=0&autoplay=1\"></param>
&LT; PARAM NAME =allowScriptAccess的价值=总是&GT;&LT; /参数&GT;
&LT;嵌入SRC =https://www.youtube.com/v/5whBYQVnjvY?modestbranding=1&rel=0&autoplay=1类型=应用/的X冲击波闪光allownetworking =内部的AllowScriptAccess = 总是的allowFullScreen =真WIDTH =320HEIGHT =430&GT;
&LT; /嵌入&GT;
&LT; /对象&gt; &LT; /身体GT;
&LT; / HTML&GT;
解决方案
试试这个:
&LT; IFRAME类=YouTube的播放器TYPE =text / html的WIDTH =640HEIGHT =385
SRC =http://www.youtube.com/embed/VIDEO_IDFRAMEBORDER =0&GT;
&LT; / IFRAME&GT;
来源:
会需要这样:
另请参阅:
This code works fine in android 2.2.But give protocol not supported error in android 4+I refered this site https://developers.google.com/youtube/player_parameters
<html>
<head>
<meta name="viewport" content="width=device-width; height=device-height;">
<title>Vadivel</title>
<style>
body
{
background-color:#588DEA;
}
</style>
</head>
<body marginwidth="0" marginheight="0">
<object width="320" height="430">
<param name="movie" value="https://www.youtube.com/v/5whBYQVnjvY?modestbranding=1&rel=0&autoplay=1"></param>
<param name="allowScriptAccess" value="always"></param>
<embed src="https://www.youtube.com/v/5whBYQVnjvY?modestbranding=1&rel=0&autoplay=1" type="application/x-shockwave-flash" allownetworking="internal" allowscriptaccess="always" allowfullscreen="true" width="320" height="430">
</embed>
</object>
</body>
</html>
解决方案
Try this:
<iframe class="youtube-player" type="text/html" width="640" height="385"
src="http://www.youtube.com/embed/VIDEO_ID" frameborder="0">
</iframe>
Source: http://apiblog.youtube.com/2010/07/new-way-to-embed-youtube-videos.html
Gonna need this: Force HTML5 youtube video
Also see: https://developers.google.com/youtube/player_parameters
这篇关于YouTube的视频嵌入在Android中4+不工作(冰淇淋三明治,果冻豆)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!