SimplePortal

Customization => Custom Coding => Topic started by: Cyst on September 19, 2008, 06:03:58 AM

Title: MP3 Player inside a block?
Post by: Cyst on September 19, 2008, 06:03:58 AM
Is there anyway way to add an mp3 player to a block? One which has the option to play, pause, skip files, and volume? It would obviously pull songs from something like /mp3s/examplealbum

Something like this: http://www.webresourcesdepot.com/open-source-flash-mp3-player/

That's a flash one though, but maybe something through JS would work? There is a Js one here: http://flash-mp3-player.net/players/js/

But it doesn't have skip file options.

My reason being it's talk like a pirate day and I want to surprise my users with some pirate songs!  :)
Title: Re: MP3 Player inside a block?
Post by: Nathaniel on September 19, 2008, 06:07:19 AM
If you already have you own code, or you are using somebody else's code then you should be able to do it with a PHP or HTML block, by adding your own code into the block.

A HTML block is probably the best block. ;)
Title: Re: MP3 Player inside a block?
Post by: Cyst on September 19, 2008, 06:12:58 AM
I just had a look over those 2 links I posted again and they both seem not to offer a simple js script for it, hmm.

Seems that they both involve swf in some way. Do you know of any simple js codes for it, so I can try it out? :)
Title: Re: MP3 Player inside a block?
Post by: Nathaniel on September 19, 2008, 06:47:37 AM
Unfortionately I don't know much about Javascipt, but one of the other team members may have a solution. I'm sure that you will find one if you do a (google?) search.
Title: Re: MP3 Player inside a block?
Post by: Cyst on September 19, 2008, 06:57:05 AM
I have been having a look on Google since I posted the thread, but no dice. They seem to all have .swf components, except for one which just caused an error in sportal.php.

It looks like it might not be possible!  :(
Title: Re: MP3 Player inside a block?
Post by: Aw06 on September 19, 2008, 10:20:47 AM
I too would love something like this, couldnt this be used

http://flash-mp3-player.net/players/multi/
Title: Re: MP3 Player inside a block?
Post by: asude on September 19, 2008, 10:45:37 AM
Download the source here:

http://flash-mp3-player.net/players/multi/download/

Create a new directory named "player" and upload the contents of the package you downloaded there.

Then create an HTML Block with these codes:

Code: [Select]
<object type="application/x-shockwave-flash" data="http://yoursite.com/player/template_multi/player_mp3_multi.swf" width="200" height="100">
<param name="movie" value="http://yoursite.com/player/template_multi/player_mp3_multi.swf" />
<param name="FlashVars" value="mp3=test.mp3|test.mp3|test.mp3&title=chanson 1|chanson 2|chanson 3" />
<p>Texte alternatif</p>
</object>

Change the FlashVars according to your needs.
Title: Re: MP3 Player inside a block?
Post by: Aw06 on September 19, 2008, 11:09:38 AM
Download the source here:

http://flash-mp3-player.net/players/multi/download/

Create a new directory named "player" and upload the contents of the package you downloaded there.

Then create an HTML Block with these codes:

Code: [Select]
<object type="application/x-shockwave-flash" data="http://yoursite.com/player/template_multi/player_mp3_multi.swf" width="200" height="100">
<param name="movie" value="http://yoursite.com/player/template_multi/player_mp3_multi.swf" />
<param name="FlashVars" value="mp3=test.mp3|test.mp3|test.mp3&title=chanson 1|chanson 2|chanson 3" />
<p>Texte alternatif</p>
</object>

Change the FlashVars according to your needs.

works like a charm  >:-D :$$:
Title: Re: MP3 Player inside a block?
Post by: Cyst on September 20, 2008, 02:21:13 PM
Download the source here:

http://flash-mp3-player.net/players/multi/download/

Create a new directory named "player" and upload the contents of the package you downloaded there.

Then create an HTML Block with these codes:

Code: [Select]
<object type="application/x-shockwave-flash" data="http://yoursite.com/player/template_multi/player_mp3_multi.swf" width="200" height="100">
<param name="movie" value="http://yoursite.com/player/template_multi/player_mp3_multi.swf" />
<param name="FlashVars" value="mp3=test.mp3|test.mp3|test.mp3&title=chanson 1|chanson 2|chanson 3" />
<p>Texte alternatif</p>
</object>

Change the FlashVars according to your needs.

Thanks for this :) Weirdly though, it isn't playing the test.mp3 for me.
Title: Re: MP3 Player inside a block?
Post by: Sentinel [AF] on October 18, 2008, 08:43:17 PM
Yah yah I think maybe this one is what you are looking for ...
It scans a specified folder on your server and automatically creates a playlist with the ones it finds.

It's free.
I've added it to the attachments.
The official website is HERE (http://www.flashmp3player.org/)

Just upload your tunes via ftp into the mp3 folder and they will be automatically added to the playlist on refresh/reload page.
The files should be installed directly to where your forums index.php is.

Copy this code into a html block.

Code: [Select]
<!-- Script that embeds player. -->
<script language="javascript" type="text/javascript">
var so = new SWFObject("flashmp3player.swf", "player", "290", "247", "9"); // Location of swf file.
so.addParam("quality", "high");
so.addVariable("content_path","mp3"); // Location of a folder with mp3 files (relative to php script).
so.addVariable("color_path","default.xml"); // Location of xml file with color settings.
so.addVariable("script_path","flashmp3player.php"); // Location of php script.
so.write("player");
</script>

<br/>

<!--
Please place this link anywhere on the page that uses Flash MP3 Player.
You can style it anyway you want, but do not change or delete it.
Read the license! Thanks. :-)
-->
Powered by <a href="http://www.flashmp3player.org">Flash MP3 Player</a>


Easy enough !
Title: Re: MP3 Player inside a block?
Post by: Aw06 on October 19, 2008, 10:15:56 AM
when you say install you mean jusst paste flashmp3player folder in my forum directory then add the songs to mp3 folder, casue im doing that but its not working
Title: Re: MP3 Player inside a block?
Post by: Sentinel [AF] on October 28, 2008, 01:25:33 PM
Errr no the flash player swf & files would have to be in your root folder.

Public_html via ftp.

Otherwise you'd have to edit the embed code for where you have the swf file.



<!-- Script that embeds player. -->
<script language="javascript" type="text/javascript">
var so = new SWFObject("mp3player/flashmp3player.swf", "player", "290", "247", "9"); // Location of swf file.
so.addParam("quality", "high");
so.addVariable("content_path","mp3"); // Location of a folder with mp3 files (relative to php script).
so.addVariable("color_path","default.xml"); // Location of xml file with color settings.
so.addVariable("script_path","flashmp3player.php"); // Location of php script.
so.write("player");
</script>

<br/>

<!--
Please place this link anywhere on the page that uses Flash MP3 Player.
You can style it anyway you want, but do not change or delete it.
Read the license! Thanks. :-)
-->
Powered by <a href="http://www.flashmp3player.org">Flash MP3 Player</a>
Title: Re: MP3 Player inside a block?
Post by: jayman2 on November 25, 2008, 12:55:52 PM
works like a charm  >:-D :$$:
I did everything in your post and setup the correct paths.  The player shows up perfectly and appears to function, but it wont play the test.mp3.  Do you have any ideas?

Thanks in advance.
Title: Re: MP3 Player inside a block?
Post by: bmac on November 26, 2008, 04:59:09 PM
Quote
The player shows up perfectly and appears to function, but it wont play the test.mp3.

I had the same problem. :(
Title: Re: MP3 Player inside a block?
Post by: Sentinel [AF] on November 30, 2008, 03:21:03 PM
Best thing when it comes to players as I've found out on SMF is to install all the .swf and js files to your forums root.
If you using files as opposed to playlist then create a folder in the forum root say "mp3" and add all mp3 files there.

Code: [Select]
<object type="application/x-shockwave-flash" data="player_mp3_multi.swf" width="200" height="100">
<param name="movie" value="player_mp3_multi.swf" />
<param name="FlashVars" value="mp3=mp3/test.mp3|mp3/test.mp3|mp3/test.mp3&title=test 1|test 2|test 3" />
<p>Texte alternatif</p>
</object>

Of course you need a mp3 in there with the title of "test" or otherwise aye it won't play anything if it doesn't exist.

I've not tested this player mind.

I'm using a custom made one for me music system and for the portal page I am using dewplayer which is from alsacreations.

Title: Re: MP3 Player inside a block?
Post by: Nabil on December 21, 2008, 11:45:04 AM
This Code to embed the Windows Media Player , wmp is found in every Computer and it plays mp3 files as well you can add the code in a php block
Code: [Select]
<?php
echo '
<OBJECT ID="MediaPlayer" WIDTH="192" HEIGHT="40" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject">
<PARAM NAME="FileName" VALUE="test.mp3">
<PARAM name="autostart" VALUE="false">
<PARAM name="ShowControls" VALUE="true">
<param name="ShowStatusBar" value="false">
<PARAM name="ShowDisplay" VALUE="false">
<EMBED TYPE="application/x-mplayer2" SRC="test.mp3" NAME="MediaPlayer"
WIDTH="192" HEIGHT="40" ShowControls="1" ShowStatusBar="0" ShowDisplay="0" autostart="0"> </EMBED>
</OBJECT>'
;
?>

Title: Re: MP3 Player inside a block?
Post by: skary on December 29, 2008, 11:32:25 PM
upload your songs somewhere. use this link http://www.mycodesplace.com/myspace-mp3-player/ to make your playlist and copy/paste the code into an HTML block
Title: Re: MP3 Player inside a block?
Post by: susanleky on June 09, 2010, 09:14:34 AM
Thank you very much but i like informaiton to you. 8)
SimplePortal 2.3.8 © 2008-2024, SimplePortal