How to play base64 audio data on firefox with using HTML5?

后端 未结 1 650
臣服心动
臣服心动 2021-01-18 04:21

I\'m trying to encode an mp3 file in base64 format. Then play it through the broswer. It works perfectly on safari and chrome, but not on Firefox.

M

1条回答
  •  耶瑟儿~
    2021-01-18 05:03

    Instead of using readAsBinaryString then base64 encoding.
    use readAsDataURL which gives you a complete data uri.

    
    

    http://jsfiddle.net/Z9pJ7/2/

    0 讨论(0)
提交回复
热议问题