Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to play jquery audio

$('document').ready(function() {
  const audio = new Audio("source.mp3" );
  audio.play();
  });
Comment

jquery play audio src

function change(sourceUrl) {
    var audio = $("#player");      
    $("#ogg_src").attr("src", sourceUrl);
    /****************/
    audio[0].pause();
    audio[0].load();//suspends and restores all audio element

    //audio[0].play(); changed based on Sprachprofi's comment below
    audio[0].oncanplaythrough = audio[0].play();
    /****************/
}
Comment

jquery play audio src

function change(sourceUrl) {
    var audio = $("#player");      
    $("#ogg_src").attr("src", sourceUrl);
    /****************/
    audio[0].pause();
    audio[0].load();//suspends and restores all audio element

    //audio[0].play(); changed based on Sprachprofi's comment below
    audio[0].oncanplaythrough = audio[0].play();
    /****************/
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: select input by name javascript 
Javascript :: js input trigger change event when set value with js 
Javascript :: jquery onclick function 
Javascript :: node js list all installed modules 
Javascript :: how can i validate an email address in javascript 
Javascript :: how to add a right click listener javascript 
Javascript :: format percentage javacsript 
Javascript :: javascript get string between two characters 
Javascript :: how to check wether the property exist in a object in java script 
Javascript :: javascript how to get a random element from an array 
Javascript :: puppeteer how to serch for text 
Javascript :: javascript calculate age given date string 
Javascript :: js onclick open the phone application 
Javascript :: split string by uppercase javascript 
Javascript :: loop 
Javascript :: javascript replace part of string 
Javascript :: adding event on keypress in javascript 
Javascript :: split array into chunks 
Javascript :: mui image 
Javascript :: three.js sphere 
Javascript :: jquery transform scale 
Javascript :: before in material ui style 
Javascript :: resolveJsonModule 
Javascript :: react material ui button router link 
Javascript :: How do I check if an element is hidden in jQuery 
Javascript :: discord javascript error cannot find module 
Javascript :: textField space between text flutter 
Javascript :: trheejs cube mesh 
Javascript :: get position of element 
Javascript :: js get hh mm ss 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =