当facebook“赞”时,我想在元数据中添加YouTube视频。我应该将opengraph类型设置为什么?
我在http://ogp.me找不到有用的答案,所以我去了这里。我得到的最接近的是how-to-post-an-youtube-video-link-through-facebook-graph-api,这是非常相关的,但更一般,并且从不提及类型。
也许在使用YouTube视频时没有类型可以吗?
答案 0 :(得分:6)
以下是YouTube使用自己网站获取的元数据的示例。使用他们的模式你不会出错。
<meta property="og:url" content="http://www.youtube.com/watch?v=Y4MnpzG5Sqc">
<meta property="og:title" content="KONY 2012">
<meta property="og:description" content="KONY 2012 is a film and campaign by Invisible Children that aims to make Joseph Kony famous, not to celebrate him, but to raise support for his arrest and se...">
<meta property="og:type" content="video">
<meta property="og:image" content="http://i2.ytimg.com/vi/Y4MnpzG5Sqc/hqdefault.jpg">
<meta property="og:video" content="http://www.youtube.com/v/Y4MnpzG5Sqc?version=3&autohide=1">
<meta property="og:video:type" content="application/x-shockwave-flash">
<meta property="og:video:width" content="398">
<meta property="og:video:height" content="224">
<meta property="og:site_name" content="YouTube">