Youtube embed video not working in android 4+ (Ice cream sandwich,Jelly Bean)

≡放荡痞女 提交于 2019-12-24 11:35:29

问题


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>

回答1:


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



来源:https://stackoverflow.com/questions/14394875/youtube-embed-video-not-working-in-android-4-ice-cream-sandwich-jelly-bean

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!