Results 1 to 3 of 3

Thread: Non-looping audio playback

  1. #1
    Join Date
    Oct 2016
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Non-looping audio playback

    1) Script Title: HTML5 background audio player

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...udioplayer.htm

    3) Describe problem:

    Great script - thanks. But I do need the audio file to play just the once and not automatically loop back to the beginning once the track has finished its first full cycle. Can somebody advise me how I can stop the track from looping please?

    Many thanks in advance

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I bet bet it's the loop setting in the script itself. Using a text only editor like NotePad, open the bgaudioplayer.js file. At the top we see:

    Code:
    /* HTML5 background audio player 
    * Created: Jan 31st, 2012 by DynamicDrive.com. This notice must stay intact for usage 
    * Author: Dynamic Drive at http://www.dynamicdrive.com/
    * Visit http://www.dynamicdrive.com/ for full source code
    */
    
    jQuery.noConflict()
    
    var bgaudioplayer = (function($){
    
    	var audio5support = !!document.createElement('audio').canPlayType
    	var d_setting = {autoplay:true, loop:true, persistTimeLine:false, volume:0.5, volumelevels:10}
    Notice the highlighted line and the red part in it. Simply remove the red part and that should prevent the audio from looping:

    Code:
    /* HTML5 background audio player 
    * Created: Jan 31st, 2012 by DynamicDrive.com. This notice must stay intact for usage 
    * Author: Dynamic Drive at http://www.dynamicdrive.com/
    * Visit http://www.dynamicdrive.com/ for full source code
    */
    
    jQuery.noConflict()
    
    var bgaudioplayer = (function($){
    
    	var audio5support = !!document.createElement('audio').canPlayType
    	var d_setting = {autoplay:true, persistTimeLine:false, volume:0.5, volumelevels:10}
    Save and use that version of the file.

    The browser cache may need to be cleared and/or the page reloaded to see changes.
    Last edited by jscheuer1; 10-11-2016 at 02:38 PM.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Oct 2016
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You're a star, jscheur1!!!!!!! Silly me forgot to even look in there! I have got so used to having the audio files called and controlling the loop, controls etc. from with an additional javascript setting within the html page where you call the audio up. Works a treat and saved me loads of work locating, installing and testing the alternatives that do use that method. Thank you so much.

Similar Threads

  1. Resolved wmp11 dvd playback is off center
    By james438 in forum Computer hardware and software
    Replies: 2
    Last Post: 09-20-2010, 04:26 AM
  2. Help Required for Flash Playback
    By xs2abhishek1237 in forum Flash
    Replies: 2
    Last Post: 07-16-2009, 07:35 PM
  3. Video Playback in Featured Content Slider
    By matthew.winkel in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 07-19-2008, 03:37 AM
  4. Auto-looping audio file.
    By dmb06851 in forum Looking for such a script or service
    Replies: 11
    Last Post: 04-20-2007, 08:40 AM
  5. How to get the playback time please?
    By dc2698 in forum ASP
    Replies: 3
    Last Post: 11-02-2006, 10:55 AM

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
  •