问题
I am trying to cache audio by serving it from the server as a base64 encoded text file. For example:
<audio src="data:audio/mp3;base64,//MkxAA......."></audio>
This approach works fine on desktop browsers such as Chrome, Firefox and IE10. However it does not work on mobile browsers. After debugging the web page on a mobile device the request is simply cancelled by the browser (tested on Chrome, Safari, Firefox and Stock Android Browser).
Does anyone know why this is occurring? I would be happy to let this go if I could understand the reason behind it and make sure I am not missing something!
Any help is greatly appreciated!
回答1:
This could possibly be a hardware issue. Depending on the size of the audio file, the browser may ignore it to conserve system memory.
来源:https://stackoverflow.com/questions/21428326/mobile-browsers-unable-to-load-base64-data-uri-for-an-audio-tag