Skip to content

Instantly share code, notes, and snippets.

@technosailor
Created June 29, 2012 16:41
Show Gist options
  • Save technosailor/3019080 to your computer and use it in GitHub Desktop.
Save technosailor/3019080 to your computer and use it in GitHub Desktop.
<?php
class My_Shoutcast_Embed {
public function __construct()
{
$this->hooks();
}
public function hooks()
{
add_action( 'init', array( $this, 'init' ) );
}
public function init()
{
add_short_code( 'shoutcast_embed', array( $this, 'shoutcast' ) );
}
public function shoutcast( $atts, $url )
{
$defaults = array( 'width' => 300, 'height' => 200, 'volume' => 100, 'codec' => 'mp3', 'bgcolor' => '#ffffff' );
$vars = shortcode_atts( $defaults, $atts );
extract( $vars, EXTR_SKIP );
$embed = <<<STREAM
<!-- BEGINS: AUTO-GENERATED Museter unlimited SHOUTcast Hosting Museter.com plans start at $6.95 CODE visit http://www.museter.com -->
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="$width" height="$height" bgcolor="$bgcolor">
<param name="movie" value="http://www.museter.com/ffmp3-config.swf" />
<param name="flashvars" value="url=$url&lang=en&codec=$codec&volume=$volume&introurl=&autoplay=true&traking=true&jsevents=false&buffering=5&skin=http://www.museter.com/skins/mcclean/ffmp3-mcclean.xml&title=stream_name" />
<param name="wmode" value="window" />
<param name="allowscriptaccess" value="always" />
<param name="scale" value="noscale" />
<embed src="http://www.museter.com/ffmp3-config.swf" flashvars="url=$url&lang=en&codec=$codec&volume=$volume&introurl=&autoplay=true&traking=true&jsevents=false&buffering=5&skin=http://www.museter.com/skins/mcclean/ffmp3-mcclean.xml&title=stream_name" width="$width" scale="noscale" height="$height" wmode="window" bgcolor="$bgcolor" allowscriptaccess="always" type="application/x-shockwave-flash" />
</object>
<!-- ENDS: AUTO-GENERATED Museter unlimited SHOUTcast Hosting Museter.com plans start at $6.95 CODE visit http://www.museter.com-->
STREAM;
return $embed;
}
}
new My_Shoutcast_Embed;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment