Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to loop audio in js

myAudio = new Audio('someSound.ogg'); 
if (typeof myAudio.loop == 'boolean')
{
    myAudio.loop = true;
}
else
{
    myAudio.addEventListener('ended', function() {
        this.currentTime = 0;
        this.play();
    }, false);
}
myAudio.play();
Comment

loop an audio javascript

myAudio.loop = true;
Comment

PREVIOUS NEXT
Code Example
Javascript :: username validation in javascript 
Javascript :: jquery detect if element has overflow 
Javascript :: step over vs step into vs step out 
Javascript :: get params in nuxtjs 
Javascript :: sleep in javascript 
Javascript :: javascript binary to int 
Javascript :: js preventdefault 
Javascript :: get user language js 
Javascript :: es6 add and remove class 
Javascript :: setinterval in angular 6 
Javascript :: javascript wait 1 second 
Javascript :: Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source. 
Javascript :: jquery get iframe content 
Javascript :: convert 2 dimensional array to js object 
Javascript :: await settimeout 
Javascript :: unique string generator javascript 
Javascript :: multer file type validation 
Javascript :: remove last character from string jquery 
Javascript :: change window location javascript 
Javascript :: logic for building calculator using JavaScript without using eval 
Javascript :: join array enclosing each value with quotes 
Javascript :: preview image file upload javascript 
Javascript :: aabb javascript 
Javascript :: add event listener on modal close 
Javascript :: js split text on spaces 
Javascript :: generate random base 64 string js 
Javascript :: scroll to a tag javascript 
Javascript :: js random number between 1 and 10 
Javascript :: replacing characters in string javascript 
Javascript :: onclick go to url 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =