HTML5 audio blob would not play on Android -
 I serve an audio file (WAV file containing a small uncompressed PCM) from my GAE app while using Bluetooth I am here. On the click event, I set the  audio. Src  and call  audio.play () . 
Now it's a weird part:
- While working locally - it performs well on both iOS and Android.
 - After deploying GAE, it plays well on iOS - but not on Android !
 
No errors were shown - it just does not play anything, as far as I can tell from the GAE log, all the files have the audio file . In the case of Android, I can see a request from "Player / LG Player 1.0 for Android 4.4.2".
What's going on, or how to debug it?
According to the suggestion of Stuart Langley, tried to run the file from Google Cloud Storage
 
 In that case,  Android plays well, and IOS does not < / Strong> (gives an error from one side.) 
 Then a solution for me is storing files on cloud storage, and calling it to  createGsBlobKey  For it a blob. On behalf of the client, I check whether this is Android ( Navigator. EagerEgent.match (Android / I) ). In the case of Android, I have set the  audio. Src  in the cloud storage file, and in case of iOS I have set it to my servlet, which is  BlobstoreService.serve  Using the Blob Key I got the file from  createGsBlobKey . 
This is a cumbersome solution and I did not check other mobile OS that works for everyone, so if someone has a better solution then please let me know.
Most likely because of the spry response when serving a blob.
There is an issue tracker object about audio files not playing properly in some browsers.
There is a test web site that I have put together, while back describing the problem.
Workaround - You can put the file on cloud storage and then run it from there, unless you are concerned about hot-linking the file.
Comments
Post a Comment