Facebook Open Graph og:video tag for YouTube videos

I have a question that was initially asked here: Open graph og:video Meta Tags content in 2010, but the answer no longer works.

I'm trying to show a YouTube video in Facebook (and have it play inside Facebook) when a link is shared. The following og:video tag on the page doesn't work (it never really did):

<meta property="og:video" content="https://www.youtube.com/watch?v=ZH4YSF-i5dY" />

The solution proposed here https://stackoverflow.com/a/17811187/188740 in 2013 worked really well until recently. It was to change the og:video to something like this (notice the way the v query string value is represented):

<meta property="og:video" content="https://www.youtube.com/v/ZH4YSF-i5dY" />

That no longer works and Facebook completely ignores it.

Another option I tried is to put the YouTube URL in og:url :

<meta property="og:url" content="https://www.youtube.com/watch?v=ZH4YSF-i5dY" />

That approach instructs Facebook to scrape YouTube to get the thumbnail image, but clicking on the post sends the user to the original page that was shared. The click behavior is the right one (I want the user to go back to the originally shared page), but there's no way for the user to play the video.

Anyone know the solution to this problem?

Update: Unfortunately, it's starting to look more and more like this is a change that Facebook made in August 2017 (and rolled out slowly across different regions over several months) and it's by design. In other words, there's no way to make this work. :-( If anyone has a workaround, it would be great for the community to know. Relevant discussions: https://developers.facebook.com/bugs/1963535797258090/ https://developers.facebook.com/bugs/364444227315183/ https://productforums.google.com/forum/#!topic/youtube/l69gPBlkXN0

链接地址: http://www.djcxy.com/p/60402.html

上一篇: 如何检查一个字符串是否包含Ruby中的子字符串?

下一篇: Facebook Open Graph og:YouTube视频的视频标签