如何为页面上放置的多个视频添加 OG 标记?我需要一个例子。
我为 1 个视频添加了标记,但不知道如何为 2 个或更多视频添加标记。
Just put video tags with necessary params as many times as you need.
Example.
Markup like this
<meta property="og:video" content="http://example.com/movie.swf" />
<meta property="og:video:secure_url" content="https://secure.example.com/movie.swf" />
<meta property="og:video:type" content="application/x-shockwave-flash" />
<meta property="og:video" content="http://example.com/movie1.swf" />
<meta property="og:video:secure_url" content="https://secure.example.com/movie1.swf" />
<meta property="og:video:type" content="application/x-shockwave-flash" />
<meta property="og:video" content="http://example.com/movie2.swf" />
<meta property="og:video:secure_url" content="https://secure.example.com/movie2.swf" />
<meta property="og:video:type" content="application/x-shockwave-flash" />
will give you (in Facebook Object Debugger)
It's all about arrays (you can dive in the doc here)
Arrays
If a tag can have multiple values, just put multiple versions of the same
<meta>
tag on your page. The first tag (from top to bottom) is given preference during conflicts.<meta property="og:image" content="http://example.com/rock.jpg" /> <meta property="og:image" content="http://example.com/rock2.jpg" />
Put structured properties after you declare their root tag. Whenever another root element is parsed, that structured property is considered to be done and another one is started.
For example:
<meta property="og:image" content="http://example.com/rock.jpg"/> <meta property="og:image:width" content="300" /> <meta property="og:image:height" content="300" /> <meta property="og:image" content="http://example.com/rock2.jpg" /> <meta property="og:image" content="http://example.com/rock3.jpg" /> <meta property="og:image:height" content="1000" />
means there are 3 images on this page, the first image is
300x300
, the middle one has unspecified dimensions, and the last one is1000
px tall.