2016-07-15 3 views
1

私は再生音に問題があります。 コンソールにエラーは表示されません。私は、PHPスクリプトからファイルを取得し、このヘッダーを設定:IE再生しないmp3をPHPスクリプト

JSで
$mime_type = "audio/mpeg"; 
    header("Content-Type: {$mime_type}"); 
    header('Content-Length: '.filesize($file)); 
    readfile($file); 

audio.src = source; 
    audio.load(); 
    audio.addEventListener('canplay', function(){ 
     audio.play(); 
    }, true); 

PHPスクリプトにsourceパスで。

答えて

2
Add this meta tag to the head: 

<メタHTTP-当量= "X-UA-互換" コンテンツ= "IE =エッジ、クロム= 1">

and also 

Try 

オーディオ/ vnd.wave

because some browser do attempt content fixing wrong MIME types. 
関連する問題