Embedded Content

Sharing Embedded Content

AddThis has introduced a new beta feature, Embedded Content Sharing, as the next step towards bringing together page and widget sharing on the AddThis network. Publishers can use the AddThis API to allow visitors to share part of a page such as a video, a flash widget or an image to any AddThis destination that supports embeddable content.

Please note that this is an early version of this feature, with more updates coming soon. As always, we'd like to hear your feedback, and will be taking any questions in the AddThis Forum.

Supported Destinations

Most destinations only accept page URLs or short strings, and do not support embedded HTML content. For example, on Twitter you can share the URL to a Flash object but not include the HTML to load the Flash within a Twitter message.

However, a few destinations do support embeddable content:

  • Blogger
  • TypePad
  • WordPress.com

The code below is a simple example demonstrating how embedded content sharing works. Please refer to the AddThis API specification for further details as to how this feature can be used.

Example

This example shows how to share a YouTube video. Destinations that support embedded content will place the video directly in the page. All other destinations will instead place a link back to the content. Here's the example javascript code that you'd use to target a video to share.

<script type="text/javascript">
	var addthis_pub = "YOUR-ACCOUNT-ID";
	var addthis_share = 
	{
		url: 'http://www.youtube.com/watch?v=Q_udqEp_YR4',
		title: "Whack-A-Kitty",
		content: '<object width="425" height="344"> '
		   		+'<param name="movie" value="http://www.youtube.com/v/Q_udqEp_YR4&hl=en&fs;=1"></param>'
				+'<param name="allowFullScreen" value="true"></param>'
				+'<param name="allowscriptaccess" value="always"></param>'
				+'<embed src="http://www.youtube.com/v/Q_udqEp_YR4&hl;=en&fs=1"'
				+'	type="application/x-shockwave-flash"'
				+'	allowscriptaccess="always"'
				+'	allowfullscreen="true"'
				+'	width="425"'
				+'	height="344"></embed>'
				+'</object>'
	};
</script>

Here is the code in action. The button below will share a cute video about a kitten, enjoy!

Whack-A-Kitty

Share

Recommended Character Limit

In addition to only a few destinations supporting content at this time, you will want keep your content under 1000 characters. The above example taken directly from YouTube is 414 characters, meaning you have plenty of space to add a message or link back to your site in the content.


Next Step