cbehan
02-18-2010, 04:27 PM
I'm trying to add a "fail" button to my forum that will play an mp3 file. I have a swf that will act as the mp3 player for the tune, and would like it to autoplay by default, but allow my users to "opt out" of autoplay.
I've set up a new custom user field for auto-playing of embeded audio, and would
like to set up the function so that users can add this tune simply by pressing a button, then depending on who is viewing the page have it autoplay or not.
Here's what I've come up with so far:
<vb:if condition="$bbuserinfo['field10'] == 'Yes'">
<object type="application/x-shockwave-flash" data="/misc/audio-player/player.swf" id="audioplayer" height="24" width="290">
<param name="movie" value="/misc/audio-player/player.swf">
<param name="FlashVars" value="autostart=yes&playerID=audioplayer&soundFile=(url of mp3)">
<param name="quality" value="high">
<param name="menu" value="false">
<param name="wmode" value="transparent">
</object>
</vb:if>
<vb:if condition="$bbuserinfo['field10'] == 'No'">
<object type="application/x-shockwave-flash" data="/misc/audio-player/player.swf" id="audioplayer" height="24" width="290">
<param name="movie" value="/misc/audio-player/player.swf">
<param name="FlashVars" value="playerID=audioplayer&soundFile=(url of mp3)">
<param name="quality" value="high">
<param name="menu" value="false">
<param name="wmode" value="transparent">
</object>
</vb:if>
The problem is that when I add it as custom bbcode, the if function doesn't work as planned. It displays both embed functions.
I'm also looking to use this same functionality to build a Not Safe For Work opt-in where pictures can be flagged as [NSFW] and have them hidden for users who set up their profile accordingly.
Thanks in advance!
Can anyone lend a hand?
I've set up a new custom user field for auto-playing of embeded audio, and would
like to set up the function so that users can add this tune simply by pressing a button, then depending on who is viewing the page have it autoplay or not.
Here's what I've come up with so far:
<vb:if condition="$bbuserinfo['field10'] == 'Yes'">
<object type="application/x-shockwave-flash" data="/misc/audio-player/player.swf" id="audioplayer" height="24" width="290">
<param name="movie" value="/misc/audio-player/player.swf">
<param name="FlashVars" value="autostart=yes&playerID=audioplayer&soundFile=(url of mp3)">
<param name="quality" value="high">
<param name="menu" value="false">
<param name="wmode" value="transparent">
</object>
</vb:if>
<vb:if condition="$bbuserinfo['field10'] == 'No'">
<object type="application/x-shockwave-flash" data="/misc/audio-player/player.swf" id="audioplayer" height="24" width="290">
<param name="movie" value="/misc/audio-player/player.swf">
<param name="FlashVars" value="playerID=audioplayer&soundFile=(url of mp3)">
<param name="quality" value="high">
<param name="menu" value="false">
<param name="wmode" value="transparent">
</object>
</vb:if>
The problem is that when I add it as custom bbcode, the if function doesn't work as planned. It displays both embed functions.
I'm also looking to use this same functionality to build a Not Safe For Work opt-in where pictures can be flagged as [NSFW] and have them hidden for users who set up their profile accordingly.
Thanks in advance!
Can anyone lend a hand?