We just made a change on YouTube videos so that at the end of playback a Facebook “share” button and a Tweetmeme “retweet” button appear as part of an effort to encourage users to spread videos in their personal social networks.
Archive for the ‘VideoSift’ Category
JavaScript Video Embed Widget
06
Apr
Cross-Domain Scripting and XMLHttpRequest | In Conclusion
Overview
At VideoSift we have always made available the embed code for every video on the site. Until now, the provided code has just been the raw <object> and <embed> tags as you would acquire directly from the video host, but we wanted to provide a much more attractive embed.
We opted to achieve such a thing by providing users with a <script> tag that builds the fancy new widget into the DOM of the host page. Initially, the plan was to just generate a pretty simple DOM structure wrapped around a video, but it evolved from there to include:
- the ability to optionally start out as a thumbnail image that when clicked will expand into the full widget
- a functional vote button that would remotely cast an up-vote for logged in members
- a brief, scrollable listing of comments on the video
There were a few interesting issues that needed to be resolved along the way:
- Where on the host page should the widget be inserted?
- What happens if the host page contains multiple widget <script> tags?
- How should we dynamically load the widget in comments on VideoSift?
- How should we cast votes on remote host pages that need to be posted to VideoSift?
3 Comments
Posted in Ajax, JavaScript, jQuery, VideoSift