我正在尝试使用Youtube's oEmbed functionality以960x580嵌入视频,但由于某种原因,它似乎已达到740的最大值。请参见以下内容:
请求:
http://www.youtube.com/oembed?url=http%3A//www.youtube.com/watch%3Fv%3DbDOYN-6gdRE&format=json&maxwidth=960&maxheight=580
响应:
{
"provider_url": "http:\/\/www.youtube.com\/",
"title": "1 of 4 Dr. Bill Lands on Cardiovascular Disease: Omega-6 displaces Omega-3",
"html": "\u003cobject width=\"740\" height=\"580\"\u003e\u003cparam name=\"movie\" value=\"http:\/\/www.youtube.com\/v\/dgU3cNppzO0?version=3\"\u003e\u003c\/param\u003e\u003cparam name=\"allowFullScreen\" value=\"true\"\u003e\u003c\/param\u003e\u003cparam name=\"allowscriptaccess\" value=\"always\"\u003e\u003c\/param\u003e\u003cembed src=\"http:\/\/www.youtube.com\/v\/dgU3cNppzO0?version=3\" type=\"application\/x-shockwave-flash\" width=\"740\" height=\"580\" allowscriptaccess=\"always\" allowfullscreen=\"true\"\u003e\u003c\/embed\u003e\u003c\/object\u003e",
"author_name": "LatestNutrition",
"height": 580,
"thumbnail_width": 480,
"width": 740,
"version": "1.0",
"author_url": "http:\/\/www.youtube.com\/user\/LatestNutrition",
"provider_name": "YouTube",
"thumbnail_url": "http:\/\/i1.ytimg.com\/vi\/dgU3cNppzO0\/hqdefault.jpg",
"type": "video",
"thumbnail_height": 360
}
除了
width
和height
,我什至尝试使用maxwidth
和maxheight
参数代替/,但是我似乎还是不能使它大于740。有什么办法可以解决这个问题,以便可以按需要的尺寸获得嵌入式视频?
最佳答案
我无法在此处粘贴代码,
我已经使用此代码使用自定义字段在wordpress中插入YouTube视频...
我需要插入与原始尺寸不同的视频。在这里您需要定义您的YouTube ID和所需的宽度
我在最后添加了一些YouTube插入选项
http://pastebin.com/KRwvSzqP
关于wordpress - YouTube嵌入宽度不能大于740像素吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5860784/