为什么 oembed 不显示 youtube 视频? [英] Why isn't oembed showing the youtube video?

查看:52
本文介绍了为什么 oembed 不显示 youtube 视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么 oembed 不显示 youtube 视频?我正在使用以下代码:

Why isn't oembed showing the youtube video? I'm using the following code:

<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/14516334@N00/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>

出于某种原因,它不会显示嵌入式播放器.这是为什么?

And for some reason it won't show the embedded player. Why is this?

推荐答案

我认为是因为有些视频没有启用 oembed/json.

I think it's because some videos are not oembed/json enabled.

如果您尝试嵌入 http://www.youtube.com/watch?v=bDOYN-6gdRE,它有效.但是您尝试嵌入的视频 http://www.youtube.com/watch?v=INVdbXTuPVI 不起作用.

If you try to embed http://www.youtube.com/watch?v=bDOYN-6gdRE, it works. But the video you are trying to embed http://www.youtube.com/watch?v=INVdbXTuPVI doesn't work.

您得到第一个链接的 401 Unauthorized 和下面第二个链接的 json 数据:

You get 401 Unauthorized for the first link and json data for the second link below:

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

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了解更多详情.

这篇关于为什么 oembed 不显示 youtube 视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆