playing a WAV file on iOS Safari

前端 未结 3 1225
说谎
说谎 2021-02-19 01:45

I\'m struggling to get a WAV file to play on a HTML page as either an HTML5 audio tag or via a regular downloadable link in mobile Safari (iPad/iPhone):



        
3条回答
  •  遇见更好的自我
    2021-02-19 02:18

    Through a run of trial and error I found that you need a content-range header for it to work. Here's an example of my headers that allows a wav file to play in Safari for iOS:

    Content-Range: bytes XX-XX/XX
    Content-Type: audio/wav 
    Content-Disposition: attachment; filename="whatever.WAV" 
    Content-Length: XX    
    

    Hope this helps!

提交回复
热议问题