Mobile app version of vmapp.org
Login or Join
Becky754

: Prompting Facebook to embed Youtube videos from a site On a website for a newspaper, some of our articles are video reports (embedded from Youtube) with small descriptions below. When these get

@Becky754

Posted in: #Embed #Facebook #Javascript #Video #Youtube

On a website for a newspaper, some of our articles are video reports (embedded from Youtube) with small descriptions below. When these get shared on Facebook, perhaps when someone copies the URL into a status, is it possible to prompt Facebook to embed the Youtube video, just as it behaves if Youtube links are pasted directly?



I noticed recently that the BBC iPlayer (in the UK) had managed to embed their videos like so. You click on the link and a flash player appears. Can anyone explain how it is done?



On click becomes...

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Becky754

1 Comments

Sorted by latest first Latest Oldest Best

 

@Tiffany637

You'll need to add some RDFa meta data to the header of your pages which contain video. For Facebook specifically, you'll need to add a <link rel="image_src" href="/URL/TO/VIDEO_THUMBNAIL.jpg" /> tag to indicate the video thumbnail, and a <link rel="video_src" href="/URL/TO/PLAY/VIDEO" /> to indicate the video player. Note that the video_src tag should refer to a URL which will actually play the video, not the video source file itself. So if you use a SWF to play the video, and the video ID is 123, that URL should be something like domain.com/video.swf?vid_id=123.

Those are the only two required variables, for Facebook. Other optional properties, which should be specified in meta tags include: medium, video_width, video_height, video_type and description.

Also note, it may take a bit of time after successfully adding these tags for Facebook to actually crawl your pages and start showing the video snippets.

There are additional ways to markup video properly in HTML pages. You can read more about these formats from Google.

Also, for testing your markup, the Facebook Debugger will likely come in very handy.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme