OG. More than 1 video on page

佐手、 提交于 2019-12-08 11:39:20

问题


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 is 1000px tall.



来源:https://stackoverflow.com/questions/18493950/og-more-than-1-video-on-page

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!