WordPress – How to Embed Twitch.tv Videos

Wordpresswordpress.com

I'm trying to embed my live stream into a page hosted on wordpress.com. I went and got the code from twitch.tv:

<object type="application/x-shockwave-flash" height="378" width="620" id="live_embed_player_flash" data="http://www.twitch.tv/widgets/live_embed_player.swf?channel=MyUsername" bgcolor="#000000">
    <param name="allowFullScreen" value="true" />
    <param name="allowScriptAccess" value="always" />
    <param name="allowNetworking" value="all" />
    <param name="movie" value="http://www.twitch.tv/widgets/live_embed_player.swf" />
    <param name="flashvars" value="hostname=www.twitch.tv&channel=MyUsername&auto_play=true&start_volume=25" />
</object>
<a href="http://www.twitch.tv/MyUsername" class="trk" style="padding:2px 0px 4px; display:block; width:345px; font-weight:normal; font-size:10px; text-decoration:underline; text-align:center;">Watch live video from MyUsername on www.twitch.tv</a>

Everything looks good in the HTML editor, but when I hit Publish, it removes the <object> tag and leaves just the <a> link.

Is there a good way to embed this type of object in the hosted version of WordPress?

Best Answer

WordPress supports oEmbed, which unfortunately isn't supported by twitch.tv. And since hosted WordPress pretty much strip unsafe codes which includes, the object tag.

There's mention of gigya shortcode - however this isn't officially documented/supported and may or may not work - but worth trying


Using this shortcode, you can insert any video that provides a flash embed code (not directly allowed in wp.com). You copy the URL and the dimensions of the video from the embed code, and you transform them into a working shortcode this way:

[gigya src="VIDEO URL HERE" width="WIDTH NUMBER HERE" 
height="HEIGHT NUMBER HERE" quality="high" wmode="transparent" 
allowFullScreen="true" ]