2014-03-13 86 views
0

我不是100%确定,如果这是Youtube的终点如果我做错了什么是错的。Youtube oEmbed html有一个额外的')'?

当我在WordPress中嵌入Youtube视频时,问题就出现了。我通过WordPress核心进行了所有调试,并将其缩小到Youtube端点的响应,该响应从YouTube上返回oEmbed。

端点:

https://www.youtube.com/oembed?maxwidth=640&maxheight=960&url=youtu.be%2FI0dQx4SNSwE&format=json 

响应(RAW):

{"thumbnail_height": 360, "width": 640, "thumbnail_width": 480, "provider_url": "http:\/\/www.youtube.com\/", "html": "\u003ciframe width=\"640\" height=\"360\" src=\"http:\/\/www.youtube.com\/embed\/I0dQx4SNSwE?feature=oembed\" frameborder=\"0\" allowfullscreen\u003e\u003c\/iframe\u003e)", "height": 360, "type": "video", "version": "1.0", "title": "Why Do We Yawn?", "author_name": "AsapSCIENCE", "thumbnail_url": "http:\/\/i1.ytimg.com\/vi\/I0dQx4SNSwE\/hqdefault.jpg", "provider_name": "YouTube", "author_url": "http:\/\/www.youtube.com\/user\/AsapSCIENCE"} 

响应:(格式化)

{ 
    "thumbnail_height": 360, 
    "version": "1.0", 
    "provider_name": "YouTube", 
    "thumbnail_url": "http://i1.ytimg.com/vi/I0dQx4SNSwE/hqdefault.jpg", 
    "title": "Why Do We Yawn?", 
    "html": "<iframe width=\"640\" height=\"360\" src=\"http://www.youtube.com/embed/I0dQx4SNSwE?feature=oembed\" frameborder=\"0\" allowfullscreen></iframe>)", 
    "provider_url": "http://www.youtube.com/", 
    "type": "video", 
    "height": 360, 
    "author_url": "http://www.youtube.com/user/AsapSCIENCE", 
    "thumbnail_width": 480, 
    "author_name": "AsapSCIENCE", 
    "width": 640 
} 

正如你可以在 'HTML' 属性年底见有一个额外的“/ iframe \ u003e”)

我做错了什么或者Youtube有什么问题吗?我无言以对。我真的很想认为YouTube会足够聪明,不会返回这样的东西,所以我必须认为这是我做错了什么...

回答