Why does not my Audio on Android compiled with Cordova play me?

0

My project is done with Javascript and compiled with Cordova.
I am using an audio tag, where I give the path of my mp3 file.

As seen in the image .. the first tag reproduces the audio correctly, but the second does not find me. Now the answer is that he does not interpret the accents.

As you can see, the first audio tag, if it reproduces and its duration appears, but in the second option its duration does not appear nor does it reproduce it ... neither do I get any type of error in the console. .. at the time of making the respective debug.

    
asked by ChiGy 13.06.2017 в 20:42
source

1 answer

0

The problem is how the path is written to the second file.

One solution is to write path to resources in URL format.

That is:

<audio src="recursos/Módulo Presentación/Archivos/PresentacionSWF/2CARACTER2/2caracter21.mp3" controls/>

You should write it like this:

<audio src="recursos/M%C3%B3dulo%20Presentaci%C3%B3n/Archivos/PresentacionSWF/2CARACTER2/2caracter21.mp3" controls/>

Example using JS

document.getElementById('encode').addEventListener('click', function() {
  document.getElementById('output').value = 
    encodeURI(document.getElementById('url').value);
});
URL: <input id="url" value="recursos/Módulo Presentación/Archivos/PresentacionSWF/2CARACTER2/2caracter21.mp3"/>
<button id="encode">Encode</button><br/>

URL encode: <input id="output"/>
    
answered by 13.06.2017 в 21:45