Pergunta

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?

Foi útil?

Solução

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" />
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top