Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Nov 2007
    Location
    London
    Posts
    1,577
    Tokens
    36

    Latest Awards:

    Default Play Mp3 "on click"

    Hello,

    I'm trying to make an enter button on a site play a 5 second mp3 clip, then redirect (after 5 seconds) to another page. I've managed the redirect, and I can make the link do two javascript things but I'm trying loads of free source code in order to make it play the mp3, and the best I can get is it asking me to open/save the mp3 file. Any ideas? I don't want it to appear in a player... but if that's the only way then it could be a player of 0 width and 0 height... if you know what I mean?

    Any help will be appreciated - the best answer will get +rep.

    Thanks
    Kind Regards,

    Guy
    __________________

    Since 2007. Unbelievable Uptime. Web hosting, resellers, master resellers, linux VPS, windows VPS, shoutcasts, at the lowest prices on the net.
    Tech-Hosts.co.uk.


  2. #2
    Join Date
    Dec 2007
    Posts
    1,683
    Tokens
    0

    Latest Awards:

    Default

    Do a normal onclick, once clicked autoplays the Mp3 (but with a non viewable player).
    Last edited by Independent; 13-06-2008 at 10:55 PM.

  3. #3
    Join Date
    Nov 2007
    Location
    London
    Posts
    1,577
    Tokens
    36

    Latest Awards:

    Default

    I had the idea of it like.. targetting the player and making it "play", and almost got it working, however, I couldn't manage to get it to play without automatically starting when the page loads.
    Kind Regards,

    Guy
    __________________

    Since 2007. Unbelievable Uptime. Web hosting, resellers, master resellers, linux VPS, windows VPS, shoutcasts, at the lowest prices on the net.
    Tech-Hosts.co.uk.


  4. #4
    Join Date
    Dec 2007
    Posts
    1,683
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by iUnknown View Post
    I had the idea of it like.. targetting the player and making it "play", and almost got it working, however, I couldn't manage to get it to play without automatically starting when the page loads.
    Somewhere in the player code it says

    Autoplay, change that too no?

  5. #5
    Join Date
    Nov 2007
    Location
    London
    Posts
    1,577
    Tokens
    36

    Latest Awards:

    Default

    Quote Originally Posted by Minor View Post
    Somewhere in the player code it says

    Autoplay, change that too no?
    Tried that, as I said, I can't get it to play then.
    Kind Regards,

    Guy
    __________________

    Since 2007. Unbelievable Uptime. Web hosting, resellers, master resellers, linux VPS, windows VPS, shoutcasts, at the lowest prices on the net.
    Tech-Hosts.co.uk.


  6. #6
    Join Date
    Dec 2007
    Posts
    1,683
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by iUnknown View Post
    Tried that, as I said, I can't get it to play then.
    Ah right, I have no more suggestions.. Sorry.

  7. #7
    Join Date
    Nov 2007
    Posts
    1,253
    Tokens
    150

    Latest Awards:

    Default

    Ok here's what I suggest.

    http://www.jeroenwijering.com/?item=JW_FLV_Player

    Get the JW FLV player (plays mp3's aswel). The top right of that page you will see a wizard button to help you set it up, then enable javascript on the player, that way you can make an onclick tell the player to load a new mp3, video or playlist.

    Hope that helps, more documentation is on the site.

    In terms of making it hidden, you could hide the DIV that its in, or you could set the size of the SWF to 1 X 1 and put it at the bottom next to a link or something. Not a perfect solution, but its a good reliable player to use.

    edit// http://www.jeroenwijering.com/?item=...pt_interaction - there's some info on the player's javascript interaction.
    Last edited by Source; 14-06-2008 at 12:28 AM.


    www.fragme.co = a project.

  8. #8
    Join Date
    Nov 2007
    Location
    London
    Posts
    1,577
    Tokens
    36

    Latest Awards:

    Default

    I can't get the player API working to play an mp3. Further help with this method will be appreciated.
    Kind Regards,

    Guy
    __________________

    Since 2007. Unbelievable Uptime. Web hosting, resellers, master resellers, linux VPS, windows VPS, shoutcasts, at the lowest prices on the net.
    Tech-Hosts.co.uk.


  9. #9
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default

    Lets set the stage on fire, and hollywood will be jealous.

  10. #10
    Join Date
    Nov 2007
    Posts
    1,253
    Tokens
    150

    Latest Awards:

    Default

    HTML Code:
    <div id="container">This text will be replaced</div>
    
    <script type="text/javascript">
      var so = new SWFObject('/embed/mediaplayer.swf','jstest','400','220','8');
      so.addParam('allowscriptaccess','always');
      so.addParam('allowfullscreen','true');
      so.addVariable('width','400');
      so.addVariable('height','220');
      so.addVariable('file','/song/nothing.mp3');
      so.addVariable('javascriptid','jstest');
      so.addVariable('enablejs','true');
      so.write('container');
    </script>
    OK that will write the player into the container you specify. " so.write('container');" replace container with the name of the DIV above the code. and make sure you have so.addVariable('enablejs','true'); otherwise it won't pick up the JS.

    Then just make a link do this either via href, or my personal preference onclick:

    <a href="#" onclick"loadFile('jstest2',{file:'/upload/nameof.mp3'});">Load MP3</a>

    make sure, jstest 2 is the javascript ID you gave it in the script for displaying the player.

    Hopefully that makes more sense.


    www.fragme.co = a project.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •