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會足夠聰明,不會返回這樣的東西,所以我必須認爲這是我做錯了什麼...