0
我試圖播放Safari瀏覽器的wav文件。幾乎相同的問題是這樣的:playing a WAV file on iOS SafariSafari瀏覽器無法播放wav文件
但接受的答案是行不通的。我正在使用帶有apache和phusion乘客的rails服務器。音頻文件在Chrome瀏覽器上播放良好,但不會在任何Safari瀏覽器(桌面,移動設備和uiwebview)上播放。
我送在軌文件與
send_file filename, :type => "audio/x-wav", :disposition => "inline"
從其他堆棧溢出q &一個,我嘗試添加的內容,範圍和內容長度標頭的響應
size = File.size(filename)
response.header["Content-Range"] = "bytes 0-#{size-1}/#{size}"
response.header["Content-Length"] = "#{size}"
我收到的錯誤是相當不倫不類的「無法加載資源:插件處理負載」
這裏是響應的標題
x-runtime 0.589797
Date Wed, 17 Aug 2016 16:38:49 GMT
X-Content-Type-Options nosniff
Server Apache/2.2.15 (CentOS)
X-Powered-By Phusion Passenger 5.0.7
Status 200 OK
Content-Type audio/x-wav
content-range bytes 0-3243/3244
Cache-Control private
Content-Transfer-Encoding binary
Content-Disposition inline; filename="eng-182-msg0026.wav"
Connection close
Content-Length 3244
X-XSS-Protection 1; mode=block
x-runtime 0.589797
你能展示你是如何解決這個問題的。我也有。 – levi