29

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

3
  • I had problems in the past with FB picking up meta information until I'd add the link on the developer preview page.
    – ian
    Commented Feb 28, 2018 at 4:46
  • It's annoying; in spite of them not rendering the video, having the video metadata in there seems to break their rendering of the og:image as well, with them falling back to some daft looking square version.
    – El Yobo
    Commented Aug 2, 2018 at 4:34
  • 1
    og:video should point to a video file. Your Youtube links are not a video file. It is a HTML page that includes a video file.
    – WizKid
    Commented Dec 12, 2022 at 17:39

0