admin管理员组

文章数量:1302887

I'm handling the touchstart and touchend events to determine when an element is clicked. It works very well and is responsive, but I'm missing the default click sound that happens in native apps when you press a button.

Is there a way to trigger this sound with PhoneGap rather then using html5 audio?

I'm handling the touchstart and touchend events to determine when an element is clicked. It works very well and is responsive, but I'm missing the default click sound that happens in native apps when you press a button.

Is there a way to trigger this sound with PhoneGap rather then using html5 audio?

Share Improve this question edited Jul 17, 2013 at 18:19 Hzyf asked Jul 17, 2013 at 17:49 HzyfHzyf 1,0172 gold badges13 silver badges21 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 6

Well, I have developed new Cordova plugin a few days ago which provide that you need.

Take look at https://github./VVelda/device-feedback

You can then call native sound response on button click. No any audio media, or any other workaround. I hope it will help you, altough you already set the answer that help you. :-)

Take a look at the Media class.

http://docs.phonegap./en/2.9.0/cordova_media_media.md.html#Media

Have a look at this blog post: http://pieterderycke.wordpress./2014/01/20/native-tick-sound-on-button-click-with-phonegap/

It explains how to develop a PhoneGap plugin that plays the native click sound when pressing a button in HTML5.

本文标签: javascriptNative tick sound on button clicks with PhoneGapStack Overflow