Page 3 of 3 FirstFirst 123
Results 21 to 24 of 24

Thread: Array to Provide One Random MP3 to Audio Tag

  1. #21
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    I'm a bit tied up at the moment but try chaining the play trigger and audio fadein;
    Code:
    $('#bgAudio').trigger('play').animate({volume: 1}, 6000);
    And just change the class of the button from .play to .pause for it's initial state;
    Code:
    <button id="pButton" class="pause" onclick="play()"></button>
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  2. The Following User Says Thank You to Beverleyh For This Useful Post:

    KennyP (01-20-2015)

  3. #22
    Join Date
    Dec 2009
    Location
    NY NY USA
    Posts
    230
    Thanks
    158
    Thanked 1 Time in 1 Post

    Default

    Thank you so much Beverley. The button now properly displays the Pause state on page load / auto play.

    The audio fade-in still doesn't work with
    Code:
    $('#bgAudio').trigger('play').animate({volume: 1}, 6000);
    It starts at full volume.

    Test Page

    --Thanks again
    Last edited by KennyP; 01-23-2015 at 09:11 AM.

  4. #23
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    Alternative option - Can you apply fades to the actual track with something like Audacity or mpTrim? http://mptrim.findmysoft.com/

    You don't even have to install mpTrim. And it's so easy to add fade in and fade out - see the bottom right corner of the GUI http://mptrim.findmysoft.com/screenshot/
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  5. The Following User Says Thank You to Beverleyh For This Useful Post:

    KennyP (01-22-2015)

  6. #24
    Join Date
    Dec 2009
    Location
    NY NY USA
    Posts
    230
    Thanks
    158
    Thanked 1 Time in 1 Post

    Default

    Beverly:

    I figured there had to be nothing wrong with the fade-in code or else it wouldn't have worked previously.
    So I tinkered with it until I finally guessed what it needed; setting the volume at 0 initially.
    Code:
        $("#bgAudio")[0].volume = 0;
            $("#bgAudio").animate({volume: 1}, 4000);
    Code Working on the Live Page

    Thank you so, so much for your help.
    Last edited by KennyP; 01-22-2015 at 11:01 AM.

Similar Threads

  1. Random Content Order script help
    By justin-nc in forum Dynamic Drive scripts help
    Replies: 4
    Last Post: 10-04-2011, 11:17 PM
  2. Random Order of Images
    By Adnan959 in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 08-11-2010, 04:56 PM
  3. Random Content Order script not so random?
    By robins in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 04-03-2009, 01:37 PM
  4. Random Content Order script - non-repeating random content
    By doomeyes in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 03-06-2008, 09:38 PM
  5. Array Order Out of Whack?
    By dr.who53 in forum Dynamic Drive scripts help
    Replies: 4
    Last Post: 01-03-2007, 10:04 PM

Bookmarks

Posting Permissions

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