Software Archive
Read-only legacy content
17060 Discussions

Intel XDK volume

Jonathan_S_
New Contributor I
304 Views

 

Olá, estou com um player de audio no meu aplicativo, onde o audio é transferido via uma url. 
Como alguns dispositivos com telas menores não exibem o botão de audio no volume, então criei uma fileira de três botões, baixo, médio e alto.
todos os botões têm a opção de onclick, com as chamadas: baixo();, medio(); e alto();.
Em uma classe JavaScript chamada de audio.js, utilizei o audio do xdk.



 

var audio = document.getElementById("audio");

var erro = "não foi.";

function baixo()
{

    audio.xdk.player.volume = 0.2;
    
} else 
{
    
    alert(erro);

}

function medio()
{

    audio.xdk.player.volume = 0.5;
    
} else 
{
    
    alert(erro);

}

function alto()
{
    
    audio.xdk.player.volume = 1.0;

} else 
{
    
    alert(erro);

}

 


O problema é que não reconhece essa própria api.

0 Kudos
2 Replies
Elroy_A_Intel
Employee
304 Views

Intel XDK only allows for playing .wav audio files. I recommend testing your application on device.

0 Kudos
Elroy_A_Intel
Employee
304 Views

Note: You should also select the plugin under the Projects Panel > Cordova Hybrid Mobile App Settings > Featured & Custom Cordova Plugins > Audio. This will include the plugin in your project when you application is built under the Build Tab or test on device under the Test Tab.

0 Kudos
Reply