Audio Play Pause and Stop using JavaScript | Play Audio using JavaScript

preview_player
Показать описание
This tutorial video to learn how to play pause and stop audio file using JavaScript.

Other Videos
================================
Form Validation using HTML5 and JavaScript

Image Gallery with thumbnail using Vanilla Javascript

Create 404 error page using HTML CSS | Simple 404 page Design

How to Create Bar Chart using ChartJS

Create Loading Screen using only HTML and CSS | Preloader Animation with CSS

Text Background Image Effect using HTML and CSS

Text animation effects | Text Rotate Animation using CSS

Create Preloader using HTML CSS and jQuery | Awesome Loading Screen for website

Button Ripple Effect using CSS and jQuery | Button Click Effects

SVG Text Animation with CSS | SVG Text Stroke Animation

Create StopWatch using javascript

Side Menu Navigation using Only HTML CSS | Side Navigation Slide using only CSS

How to use display flex | css3 display flex tutorial | display flex example

CSS3 keyframes animation | CSS3 moving dropdown animation

CSS3 keyframes Animation | CSS3 Keyframes moving Animation

bootstrap4 responsive navbar | Responsive header using bootstrap navbar | Bootstrap Responsive Menu

Bootstrap 4 Modal popup Example | Create Popup using Bootstrap4 | Bootstrap modal Dialog show

#JavaScript #AudioPlay
Рекомендации по теме
Комментарии
Автор

If you want to resdet the play-button automatic to PAUSE after the sound is played, I just added jQuery to the script and this code in the javascript in the finction playPause at the end:

$(document.getElementById('audio')).bind("ended", function() {
stop();
});

This worked for me 😁

huubfievez
Автор

Thanks a lot buddy ... You taught me in very simple way

rajubarve
Автор

I not found source code in your Web site
please provide a direct link

Ai
Автор

Thank you so much brother.. you made it in easy way... One question
. will adding audio makes a website slow?

hajimeippo
Автор

Thank you for your time, it is neat and clear, I have a questions, when the track reaches the end, the button does not change back to the pause image. How to do that please?

akhtar_topics
Автор

All of your audio files listed in the JavaScript code MUST be named as HTTPS, not HTTP. And obviously, that means the website(s) you are linking to (including yours) must be secure. That is, you need to have your security certificate, and make sure it is activated. It's a security issue with Chrome. I hope that helps. God bless.

redeemedsinner
Автор

I don't insert one audio into <audio id="audio">
<source src="./SieuNhanGao.mp3" type="audio/mpeg">
<source src="./HuricangerSanjou.mp3" type="audio/mpeg">
</audio>. It's just run the first audio.

aiquochuynh
Автор

Excellent my friend!!! @Chattesla

thankYou

Chatesla
Автор

can you add a video on explanation about the code

adityaghaywat
Автор

I have made many buttons that play audio with javascript, and although it's very entertaining to hit as many buttons and make a racket, I would like to limit the playing capability to wait until the first playing sound is finished until you can play the second audio, and so forth...how can I do that? something like it returns a true or a false value depending ...

alexaraya
Автор

plsss help sir how can i apply it using by instead i use click, i will you keyboard button

stevebryansedigo
Автор

how do i play this same audio across all pages

vivaanshrivastava
Автор

I'd like to know what does the if statement with the var count 0 and 1 to understand better the code :(

jeisongarzon
Автор

Yadi do audio track lagana ho to kese karein ?

friendsarethesunshineoflif
Автор

thank you very much it worked for me 🙏🏼

lesnoopy
Автор

i'm getting error of these line of codes

techwithshudarsan
Автор

I despise tutorials that refuse to explain things like a human being.

AkamatsuCreative
Автор

Pause is not working and I copy pasted ur code.

elcondelucanor
Автор

Is there anyone who can explain the code, please?

musakazim
Автор

I not found source code in your Web site
please provide a direct link

nitinjangra