0

何時間も問題を解決しようとした後、私は気が狂ったと思います:S

私のウェブサイトには、ローカル (Apache by XAMPP) では正常に動作する ogg サウンドがありますが、.htaccess にすべての MIME タイプ (audio/ ogg ogg) および (アプリケーション/ogg ogg)。

これは、ローカル(作業中)で取得したヘッダーです。

Request URL:http://127.0.0.1/bass.ogg
Request Method:GET
Status Code:206 Partial Content
Request Headersview source
Accept:*/*
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:identity;q=1, *;q=0
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Cookie:PHPSESSID=08e4d19b19720f0a5491c20a7bba20c7
Host:127.0.0.1
Range:bytes=0-
Referer:http://127.0.0.1/
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.160 Safari/537.22
Response Headersview source
Accept-Ranges:bytes
Cache-Control:max-age=2592000
Connection:Keep-Alive
Content-Length:59290
Content-Range:bytes 0-59289/59290
Content-Type:audio/ogg
Date:Fri, 15 Mar 2013 08:58:14 GMT
Expires:Sun, 14 Apr 2013 08:58:14 GMT
Keep-Alive:timeout=5, max=98
Last-Modified:Sat, 09 Mar 2013 14:23:45 GMT
Server:Apache/2.2.14 (Unix) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l PHP/5.3.1 mod_perl/2.0.4 Perl/v5.10.1

これは、VPS で取得したヘッダーです (動作していません):

Request URL:http://www.mysite.com/jazz.ogg
Request Headersview source
Accept-Encoding:identity;q=1, *;q=0
Cache-Control:max-age=0
Range:bytes=0-
Referer:http://www.mysicians.com/
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.160 Safari/537.22

最終的にぐっすり眠れるように、あなたが助けてくれることを願っています :) ありがとう

4

1 に答える 1

0

I found a solution by myself and i hope it will help some people.

As you, all works fine on my local server Wamp. the problem was on my VPS with Apache. After adding this following lines in my .htaccess file (line 1 should be enough for ogg extension):

AddType audio/ogg .oga
AddType video/ogg .ogv .ogg
AddType video/webm .webm
AddType video/mp4 .mp4

I still had trouble with Google chrome, i could play the sound in Firefox, Internet Explorer, Safari but not Chrome. I search hours and hours without finding the solution. It may be related to codecs but i'm not sure.

Finally, i worked around the bug by calling a distance source where the sound is played proprely.

Exemple in html5 with different sources to make sure the sounds plays in all browsers:

<audio id="sound">
  <source src="sound.wav" />
  <source src="http://www.another-website.com/sound.mp3" />
  <source src="sound.mp3" />
  <source src="sound.ogg" />
  <embed  src="sound.mp3"></embed>
</audio>
于 2013-09-30T12:07:06.367 に答える