1

此代码在 android 2.2 中运行良好。但在 android 4+ 中给出不支持协议的错误我参考了这个网站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>
4

1 回答 1

2

试试这个:

<iframe class="youtube-player" type="text/html" width="640" height="385"
src="http://www.youtube.com/embed/VIDEO_ID" frameborder="0">
</iframe>

来源:http ://apiblog.youtube.com/2010/07/new-way-to-embed-youtube-videos.html

需要这个:强制 HTML5 youtube 视频

另请参阅:https ://developers.google.com/youtube/player_parameters

于 2013-01-18T08:23:34.813 回答