我用html5(音頻標籤)打開OGG文件。 在一個網站上工作,另一個不工作。爲什麼?不要打開OGG文件
例如:
http://devluntegg.fishok.getmyip.com:39875/webim/sounds/new_user.ogg - 工作(播放)
http://lovisnami.ru/webim/sounds/new_user.ogg - 不工作(建議維持)
HTML和JS一樣。
我用html5(音頻標籤)打開OGG文件。 在一個網站上工作,另一個不工作。爲什麼?不要打開OGG文件
例如:
http://devluntegg.fishok.getmyip.com:39875/webim/sounds/new_user.ogg - 工作(播放)
http://lovisnami.ru/webim/sounds/new_user.ogg - 不工作(建議維持)
HTML和JS一樣。
第一個URL返回
Content-Type: audio/ogg
第二個
Content-Type: application/octet-stream
不同的Web服務器設置。
其中只有一個是ogg文件。另一個是二進制數據的一塊。
(至少,這是服務器告訴瀏覽器)。
您需要正確配置服務器。
[email protected]:~ # curl -I http://devluntegg.fishok.getmyip.com:39875/webim/sounds/new_user.ogg | grep Content
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 13889 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
Content-Length: 13889
Content-Type: audio/ogg
[email protected]:~ # curl -I http://lovisnami.ru/webim/sounds/new_user.ogg | grep Content % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 13889 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
Content-Type: application/octet-stream
Content-Length: 13889
具體在哪裏需要註冊? – Luntegg
取決於您的網絡服務器。 –
我看,它是nginx。可能是/etc/nginx/mime.types或類似的。 –