Flash MP3 Player Support Product Page

Answered

Does the latest version allow for dynamic data?

Asked 16 Jul 2010 19:06:41
1
has this question
16 Jul 2010 19:06:41 Robert Robinette posted:
I have a database with mp3s that list on the page in a repeat region ordered by date entered. I want a small flash player next to each one that will play only the associated mp3 file. Can I add this player to the repeat region choosing the mp3 from the data source?

Replies

Replied 19 Jul 2010 10:00:27
19 Jul 2010 10:00:27 Miroslav Zografski replied:
Hello Robert,

You do not need a multiple instances of flash player.
What you can do is following.

1. add one FlashMP3 Player to your page.
2. in UI of the flayer click on "Add new song" button.
3. in the resulted dialog box in top center part change the selected radio button to "Data Sources".
4. Select from your preset record set the column, which holds the mp3s.
5. Set the player to your liking and finish adding it with clicking "OK" button.
6. Now open the code view and find the script tag for the player.
it will look like this :
<script type="text/javascript">
	 // <![CDATA[
 var flashMP3Player1 = new dmxMP3Player("apple_player", "fl_flashMP3Player1", "270", "120");
     flashMP3Player1.setScriptLibrary("../ScriptLibrary");
     flashMP3Player1.addVariable("mp3s", "<?php echo $row_Recordset1['filename']; ?>");
     flashMP3Player1.addVariable("playerColor", "0x6699FF");
     flashMP3Player1.write("dv_flashMP3Player1");
  // ]]>

7.select the following :
, "<?php echo $row_Recordset1['filename']; ?>"

and from server behaviors choose Repeat region.
8. Repeat Region will probably not fit your selection but rather the Script tag.
<p>&nbsp;<?php do { ?>
    <span id="dv_flashMP3Player1"></span>
  <script type="text/javascript">
	 // <![CDATA[
 var flashMP3Player1 = new dmxMP3Player("apple_player", "fl_flashMP3Player1", "270", "120");
     flashMP3Player1.setScriptLibrary("../ScriptLibrary");
     flashMP3Player1.addVariable("mp3s", "<?php echo $row_Recordset1['filename']; ?>");
     flashMP3Player1.addVariable("playerColor", "0x6699FF");
     flashMP3Player1.write("dv_flashMP3Player1");
  // ]]>
  </script>
    <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?> </p>

So edit the code so it embrace only the selection:
flashMP3Player1.addVariable("mp3s", <?php do { ?>"<?php echo $row_Recordset1['filename']; ?>"<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>);

9. Once this is done and working add near each song a play button image of your liking and attach to it a behavior to control the Player by selecting the image in design view and in TAG INSPECTOR panel click on BEHAVIORS and then on [+] button. There choose DMXzone -> Control Flash MP3 Player.
10. in resulted dialog box choose for action Play. and click OK.
11. Add once more Flash MP3 controlling behavior to that same Play image but this time for action choose Go To and for Number choose the number of the mp3 (starting from 0).
Do 9->10->11 steps for each song or add this once inside a repeat region.
Advice:
use one record set for Player and another for your displayed MP3s - they might be one and same.

Regards,
Replied 19 Jun 2011 16:54:59
19 Jun 2011 16:54:59 Jeff Spijkers replied:
I have tried this and no matter what I do, it just doesn't work![v]

I have followed your instructions to the letter and NOTHING!

Just an empty space where a playlist with buttons should be. Not even the player shows up!

I have tried every possible configuration and nothing works.
  • Ajax Datagrid with row behaviors - No go.
  • Table with repeat region - No go. (this was the only way I could get a way to place a repeating play button.)
  • Repeat region around the whole player script - No go.
  • Repeat region around the record set as per your instructions - No go (player completely disappears.


I am so frustrated with DMXzone extensions! I used to think the world of them... recommended them to my friends... Now they just keep getting worse and worse...

Would someone there PLEASE create a proper tutorial that WORKS!?!

Not all of us are PHP Guru's you know!
Replied 20 Jun 2011 08:46:37
20 Jun 2011 08:46:37 Miroslav Zografski replied:
Hello Jeff,

Adding a dynamic MP3 player is best accomplished with the HTML5 MP3 Player.
Flash MP3 Player has a number of limitations and requires extended knowledge in Server Side Scripting.

Your Flash MP3 Player did not show when you follow these instructions because the songs are not correctly filled in the script tag ( which is my fault not explaining this here).
They are set like :
sog1.mp3song2.mp3... and so on
while they need to be coma separated:
song1.mp3, song2.mp3... and so on.

With the HTML5 MP3 Player you can have a dynamic table with your MP3's from a record set inside a MP3 Player region and each mp3 link will become a stand alone player ( obviously you need to set the mp3's as links).

Regards,

Reply to this topic