Facebook Open Graph og:video tag for YouTube videos

匿名 (未验证) 提交于 2019-12-03 02:30:02

问题:

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

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