当 facebook "Like":ing 时,我想在元数据中附加一个 youtube 视频。我应该将 opengraph 类型设置为什么?
我在 http://ogp.me 上找不到有用的答案,所以我去了这里。我得到的最接近的是 how-to-post-an-youtube-video-link-through-facebook-graph-api ,这是非常相关的,但更笼统,并且从未提及类型。
也许在使用 youtube 视频时没有类型是可以的?
最佳答案
以下是 YouTube 使用其自己网站的 og 元数据的示例。使用他们的模式不会出错。
<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">
关于youtube - 什么是合适的 og :video:type for an external (youtube) video?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9575402/