and like us on FB

In the video hosting world, LiveLeak is like a social sewer; it hosts graphic, pornographic, and other videos that violate about every other website term of service. The confronting videos that LiveLeak makes a habit of hosting include the execution of James Foley, the anti-Quran film Fitna, and the execution of Suddam Hussein… with website founders sticking to their (commercially motivated?) mantra of permitting free speech, or “redefining the media”

Founded in 2006, the site claims that they aim to take reality footage, politics, war, and other world events and combine them with the power of citizen journalism. At the time of writing the site is the 642nd most popular website globally.

The popularity of LiveLeak isn’t reflected in their less-than-ideal aesthetics and mobile presence, and the rich sharing options on other similar websites are far superior to those on LiveLeak.

In an effort to generate shortcode that’ll render LiveLeak videos, we’re required to take a rather unconventional approach and scrape the LiveLeak video page for the relevant embed information. However, once the LiveLeak website is scraped for a particular video ID, we don’t query that page again.

The code on this page isn’t ideal… but it’s about the best option available, and it’s still more scalable than using video specific embed code on every post or page where a LiveLeak video is required.

The Result

Using the shortcode of [liveleak v="http://www.liveleak.com/view?i=100_1338007444"] or just [liveleak v="100_1338007444"] we’ll render a LiveLeak video as follows:

Shortcode Attributes

v

Use [liveleak v="http://www.liveleak.com/view?i=100_1338007444"] or just [liveleak v="100_1338007444"]. Using just the video ID is preferred.

width

The width is the width of your embedded video. Alter the default “560” in the shortcode function for the width of your own WordPress post container. The video is responsive so will scale to mobile devices.

height

The video height (or height) doesn’t need to be defined unless our auto scaling isn’t suitable. We’ll automatically create a video height based on your defined width.

WordPress Shortcode

Copy and paste the WordPress function into your theme's functions.php file or, if you sensibly have one installed, your custom functions plugin.

If you require shortcode to work in a sidebar widget, you'll have to enable the functionality with a filter. If you're using our custom functions plugin, you'll have that feature enabled by default.

Considerations

  • As stated, the expression to find the video embed ID isn’t ideal. If the page HTML changes please let us know and we’ll update the code.

Shortt URL for this post: http://shor.tt/14oD