Last active
August 29, 2015 14:21
-
-
Save kurozumi/45d6da3e8ee873018b77 to your computer and use it in GitHub Desktop.
【ワードプレス】ツイキャス(TwitCasting)を自動メディアリンクに対応させる方法
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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