MediaElement.js - HTML5 Video & Audio Player
Audio [wav] doesn't loop (7 posts)

  1. shinfo
    Posted 3 years ago #

    My code:

    [audio src="http://MYURL.com/wp-content/uploads/2012/07/MYFILE.wav" loop="true" width="960" preload="true" autoplay="true"]

    Refuses to repeat. I need it to repeat automagically, because I have a "rainymood" style wav that's supposed to be seamless.


  2. drmikegreen
    Posted 2 years ago #

    Try adding
    $attributes[] = 'loop="loop"';
    at line 388 of mediaelement-js-wp.php. I.e., just after

    if ($loop) {
    	$options[]  = 'loop: ' . $loop;

    This does the trick for an mp3 audio when Chrome is the browser, but does not help with Firefox (both in Ubuntu Linux). I haven't had the opportunity yet to check other browser/operating system combinations.

  3. drmikegreen
    Posted 2 years ago #

    OK. I think I now have the full set of corrections needed to make audio looping work as it should. The diff file is:

    --- Downloads/media-element-html5-video-and-audio-player/mediaelement-js-wp.php	2012-06-01 08:37:01.000000000 -0500
    +++ mediaelement-js-wp.php	2012-08-04 14:57:55.000000000 -0500
    @@ -382,9 +382,10 @@
     		$attributes[] = 'autoplay="'.$autoplay.'"';
    -	// MEJS JavaScript options
    -	if ($loop) {
    -		$options[]  = 'loop: ' . $loop;
    +	// Loop options
    +	if ($loop && 'false' != $loop) {
    +		$options[]    = '"loop": true';
    +		$attributes[] = 'loop="loop"';
     	// CONTROLS array

    With these changes the audio loops in Firefox 14 in both Linux and Windows 7, Chrome 21 in both Linux and Windows 7, Internet Explorer 8 in Windows 7, and Safari 5 in Windows 7 and (I am told by a co-worker) in Mac (I was not told what version). I could check it in a few other browsers, but feel that is likely to be a sufficient sample.

  4. maorz
    Posted 2 years ago #

    Thank you drmikegreen!!! your fix worked!!!

  5. pdavisnwa
    Posted 2 years ago #


    Thank you!!! The loop issue has dogged me for over a year. Thank you for your resolution of this very aggravating problem.

  6. aryanchoudhary
    Posted 2 years ago #

    WAV file Format is not working on IE. ANy suggestion?

    Thanks in Advance!


  7. simonadp
    Posted 2 years ago #

    the loop doesn't work also with mp3 files. please any help...

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • MediaElement.js - HTML5 Video & Audio Player
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.