Mobile browsers unable to load base64 data uri for an <audio> tag

时光总嘲笑我的痴心妄想 提交于 2019-12-04 09:46:47

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!