Play mp3 file using jquery

How can I play an mp3 file using jquery on a website. I use servlets or http to play a song. Just like I can calculate the total playing time of a song.

Relations Angelina

+3
source share
2 answers

You can add an element with your sound to the page:

var sound = $('<embed autoplay="true" height="0" width="0" />');
sound.attr('src', urlOfMyMp3);
$('body').append(sound);

Source: Embed MP3 on the site

+3
source

Try something like jPlayer .

+3
source

Source: https://habr.com/ru/post/1747343/


All Articles