问题
How can I add OG markup for more than 1 video, placed on a page? I need an example please.
I had added markup for 1 video but have no idea how to do it for 2 or more.
回答1:
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.
来源:https://stackoverflow.com/questions/18493950/og-more-than-1-video-on-page