Play audio using jquery mobile

using html 5 and request mobile I have a page with 3 buttons:

I want each button to select a different sound, and then another button to play the selected sound.

Can someone give me a steering wheel?

thanks

Jim

+6
source share
1 answer

Refuse the HTML5 <audio> . You can preload audio clips and play them when the user interacts with elements.

Docs for <audio> : https://developer.mozilla.org/en/HTML/Element/audio

You may want to check out a ready-made plugin for this, I saw that JPlayer used a lot: http://jplayer.org/

Although the plugin is not needed, the HTML5 <audio> has the ability to control it using JavaScript.

+8
source

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


All Articles