문제

I am developing an application for android mobile using kendo ui mobile. My requirement was to enable tapping sound for buttons, anchors and so on. I search for it on Google a lot but did not see any setting or way to enable this functionality. can anyone help me on this?

도움이 되었습니까?

해결책

You could try something like adding an audio element to your view, like so:

<audio id="sfx-burp" 
        src="audio/burp.wav" 
        preload="auto">
</audio>

Notice the preload parameter here. This makes sure the audio should be immediately loaded when you page loads, which could be an issue with Kendo. Next, in order to actually play the sound effect you can simply run .play() on the element. Or wrap it up in something more generic like:

function playBurpSound() {
    try {
        $('sfx-burp').play();
    } catch(err) {
        console.log('Error on playBurpSound: ' + err);
    }
}

If you've got a native kendo button, it's as easy as the following to execute it:

<a data-role="button" data-click="playBurpSound" />
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top