Skip to content

Instantly share code, notes, and snippets.

@kurozumi

kurozumi/functions.php

Last active Aug 29, 2015
Embed
What would you like to do?
【ワードプレス】ツイキャス(TwitCasting)を自動メディアリンクに対応させる方法
wp_embed_register_handler(
'twitcasting',
'#http://twitcasting.tv/(.*)$#i',
function($m, $attr, $url, $rawattr){
$width = 320;
$height = 198;
return <<< __EOS__
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="{$width}" height="{$height}" id="livestreamer" align="middle">
<param name="allowScriptAccess" value="always" />
<param name="allowFullScreen" value="true" />
<param name="flashVars" value="user={$m[1]}&lang=ja&mute=0&cupdate=0&offline=" />
<param name="movie" value="http://twitcasting.tv/swf/livestreamer2sp.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="http://twitcasting.tv/swf/livestreamer2sp.swf" quality="high" bgcolor="#ffffff" width="{$width}" height="{$height}" name="livestreamer" id="livestreamderembed" align="middle" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" flashVars="user={$m12]}&lang=ja&mute=0&cupdate=0&offline=" >
</object>
__EOS__;
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment