Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2010-07-31 08:27:34

Katalonian
Member
From: Baku, Azerbaijan
Registered: 2010-04-18
Posts: 219
Website

Re: an7_audio

there is no way to use for mp3 files ID of file, not name ?


<txp:txp_me />

Offline

#14 2010-11-27 21:46:45

sebatorresi
Member
From: Spain
Registered: 2009-05-27
Posts: 105
Website

Re: an7_audio

I want to do a contribution, isn’t a big thing, but it could be useful if you want to have a custombizable skin.

You shall edit the an7_audi plugin.
First at all sorry for my bad english.

Here is what i’ve changed.

function an7_audio($atts, $thing='') {
	$plugindir='/js';				// Directory where plugin files reside
	$audiodir='/audio';  			// Directory where audio files reside
	extract(lAtts(array(
		'audio' => '',
		'autostart' => 'false',		// Autostart; true / false
		'repeat' => 'false',		// Repeat; true / false
		'digits' => 'true',			// show Time and Time remaining texts; true / false
		'volume' => '100',			// default Volume level; 0-100
		'width' => '300',			// player Width in pixels
		'height' => '29',			// player Height in pixels, 20 is default (1px shadow)
	),$atts));
									// link and download button
									// needed for Feedburner podcasts
	$download='<a href="'.$audiodir.'/'.$audio.'"><img src="/images/audio_download.gif" alt="download" name="download" width="16" height="19" border="0" /></a>';
$script= <<< END
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="$width" height="$height" id="player1" name="player1">
   <param value="$plugindir/player.swf" name="movie">
   <param value="false" name="allowfullscreen">
   <param value="always" name="allowscriptaccess">
   <param value="file=$audiodir/$audio&amp;volume=$volume&skin=$plugindir/glow/glow.xml" name="flashvars">
   <embed id="player1"
          name="player1"
          src="$plugindir/player.swf"
          width="$width"
          height="$height"
          allowscriptaccess="always"
          allowfullscreen="false"
          flashvars="file=$audiodir/$audio&amp;volume=$volume&skin=$plugindir/glow/glow.xml"
   />
</object>
END;
	$output = '<div class="$class">'.$download.$script.'</div>';
	return $output;
}
function an7_audioscript($atts, $thing='') {
	$plugindir='/js';				// Directory where plugin files reside
	$audiodir='/audio';  			// Directory where audio files reside
	extract(lAtts(array(
		'audio' => '',
		'autostart' => 'false',		// Autostart; true / false
		'repeat' => 'false',		// Repeat; true / false
		'digits' => 'true',			// show Time and Time remaining texts; true / false
		'volume' => '80',			// default Volume level; 0-100
		'width' => '300',			// player Width in pixels
		'height' => '29',			// player Height in pixels, 20 is default (1px shadow)
	),$atts));
									// Feedburner link and download button
									// (link is needed for Feedburner podcasts)
	$download='<a href="'.$audiodir.'/'.$audio.'"><img src="/images/audio_download.gif" alt="download" name="download" width="16" height="19" border="0" /></a>';
	static $playerid=1;
$script= <<< END
<span id="player$playerid"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</span>
<script type="text/javascript">
	var FO = { movie:"$plugindir/player.swf",width:"$width",height:"$height",majorversion:"9",build:"0",
			flashvars:"file=$audiodir/$audio&amp;volume=$volume&skin=$plugindir/glow/glow.xml" };
UFO.create(FO,"player$playerid");
</script>
END;
	$output = '<div class="'.$class.'">'.$download.$script.'</div>';
	$playerid++;
	return $output;
}

Here is what i made

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="$width" height="$height" id="player1" name="player1">
   <param value="$plugindir/player.swf" name="movie">
   <param value="false" name="allowfullscreen">
   <param value="always" name="allowscriptaccess">
   <param value="file=$audiodir/$audio&amp;volume=$volume&skin=$plugindir/glow/glow.xml" name="flashvars">
   <embed id="player1"
          name="player1"
          src="$plugindir/player.swf"
          width="$width"
          height="$height"
          allowscriptaccess="always"
          allowfullscreen="false"
          flashvars="file=$audiodir/$audio&amp;volume=$volume&skin=$plugindir/glow/glow.xml"
   />
</object>

and

<script type="text/javascript">
	var FO = { movie:"$plugindir/player.swf",width:"$width",height:"$height",majorversion:"9",build:"0",
			flashvars:"file=$audiodir/$audio&amp;volume=$volume&skin=$plugindir/glow/glow.xml" };
UFO.create(FO,"player$playerid");
</script>

Ok, in <param value="file=… and flashvars="file=... you can see this code that have two parts file=$audiodir/$audio&amp;volume=$volume&skin=$plugindir/glow/glow.xml. you can see this code that have two parts $audiodir and the another one is the skin file &skin=.

I had to put the skin file into the js folder because i can’t figure out how to make another folder hehehe for the skin. Inside the “glow” folder are the skin files. You can download skins from here or you can make your skins with this tutorial

I hope you understand my english :)

I’m still working on it but works.

Thanks a lot for this plugin!!! :)


Sonríe | Smile . <txp:lover />

Offline

Board footer

Powered by FluxBB