Search
 
SCRIPT & CODE EXAMPLE
 

HTML

audio play limit using jquery

<audio id="audio_file" class="myAudio" controls >
  	<source src="sound.ogg" type="audio/ogg">
	<source src="sound.mp3" type="audio/mpeg">
</audio>
<script>

// Audio file will be played two times only after that is any user tries to play it won't work.
  var loopCount = 0;

  $('#audio_file').on('ended', function(){
    loopCount++;
  })
  $('#audio_file').on('play', function(){
    if(loopCount == 2) {
      this.pause();
    }
  })
</script>
Comment

PREVIOUS NEXT
Code Example
Html :: const uno = <h1hola, 1</h1 
Html :: location nearby html 
Html :: asp.net get innerhtml of div 
Html :: physical and logical tags in html 
Html :: redirect onclick with button 
Html :: html detection vpn script 
Html :: Capturing the amount of space related to the text html 
Html :: html insert link text with hover color 
Html :: How To Create "Empty" <Label Tag Without Name 
Html :: can i use html in android studio 
Html :: what is the defrence between head and title in html 
Html :: drag and drop textarea html 
Html :: estrutura html 
Html :: loading page html 
Html :: infinityblogger.in 
Html :: thml text are 
Html :: file type input limit in html 
Html :: html. strong 
Html :: snake game in html 
Html :: how to get 2 headings in same line in html 
Html :: html web page examples with source code 
Css :: htaccess for angular 
Css :: font helvetica css 
Css :: remove underline hover css 
Css :: how to remove markers in css 
Css :: center h1 css 
Css :: input type search remove x 
Css :: input autocomplete css color 
Css :: font border css 
Css :: how to get an angled section end css 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =