2011-04-13 134 views
0

为什么不显示youtube视频? 我使用下面的代码:为什么不显示youtube视频?

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<title>FriendsConnect | Find Friends</title> 
<!--Start FC online dependincies--> 
<script src="http://friendsconnect.org/jquery_custom/js/jquery-1.4.2.min.js" type="text/javascript"></script> 
<script src="http://friendsconnect.org/jquery_custom/js/jquery-ui-1.8.7.custom.min.js" type="text/javascript"></script> 
<link href="http://friendsconnect.org/jquery_custom/css/fc-blue/jquery-ui-1.8.7.custom.css" rel="stylesheet" type="text/css" /> 
<script type="text/javascript" src="../secure_serv/users/oembed/jquery.oembed.js"></script> 
<!--End FC online dependancies--> 
<script> 
$(document).ready(function() { 
    $("button").button(); 
    $(".radio").buttonset(); 

      $(".oembed").oembed("http://www.flickr.com/photos/[email protected]/345009210/"); 
    $("input:button").button(); 
    }); 
</script> 
    <style type="text/css"> 
     .style1 
     { 
      width: 83px; 
     } 
     .style2 
     { 
      width: 144px; 
     } 
     #Button1 
     { 
      font-size: 9px; 
     } 
     a:link { 
    text-decoration: none; 
    color: #000000; 
} 
a { 
    text-decoration: none; 
    color: #091419; 
} 
a:visited { 
    color: #091419; 
} 
a:hover { 
    text-decoration: underline; 
    color: #091419; 
} 
    </style> 
<style type="text/css"> 
html, 
body {background-color: transparent;} 
</style> 
</head> 
<body style="font-family: Arial, Helvetica, sans-serif;"> 
<a href="http://www.youtube.com/watch?v=INVdbXTuPVI&feature=feedu" class="oembed">ssss</a> 
<div id="container"></div> 
</body> 
</html> 

而由于某种原因,将不显示嵌入式播放器。为什么是这样?

回答

2

我认为这是因为一些视频未启用/ json启用。

如果您尝试嵌入http://www.youtube.com/watch?v=bDOYN-6gdRE,它可以正常工作。但您试图嵌入的视频http://www.youtube.com/watch?v=INVdbXTuPVI不起作用。

你得到401未经授权的第一链路和JSON数据下面的第二个链接:

http://www.youtube.com/oembed?url=http://www.youtube.com/watch?v=INVdbXTuPVI http://www.youtube.com/oembed?url=http://www.youtube.com/watch?v = bDOYN-6gdRE

有关详细信息,请参阅http://core.trac.wordpress.org/ticket/14377

+0

你是对的,在我进一步研究之后,我发现视频不可嵌入。 (如果这是一个字大声笑) – 2011-04-13 20:55:55