Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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?

enter image description here

On click becomes...

enter image description here

share|improve this question

1 Answer 1

up vote 3 down vote accepted
+50

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 http://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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.