Note that there are some explanatory texts on larger screens.

plurals
  1. POHTML5 audio with PHP script does not work on iPad/Iphone
    text
    copied!<p>Ok, I'm trying to play an HTML audio code on iPad but does not work.</p> <p>I created one PHP script to send to the MP3 request to the HTML5 audio code</p> <blockquote> <p>mp3_file_player.php?n=mp3file.mp3</p> </blockquote> <p>The player is here: <a href="http://www.avault.com/news/podcast-news/john-romero-podcast-episode-80/" rel="noreferrer">http://www.avault.com/news/podcast-news/john-romero-podcast-episode-80/</a></p> <p>You will see that works on every HTML5 supported browser even on my iPod Touch. But does not work on iPad/iPhone, even on Safari on Mac OSX (I tried on Safari/Windows, worked fine)</p> <p>This is my PHP code:</p> <pre><code>header("X-Powered-By: "); header("Accept-Ranges: bytes"); header("Content-Length: ". (string)(filesize($episode_filename)) .""); header("Content-type: audio/mpeg"); readfile($episode_filename); exit(); </code></pre> <p>Everything works fine, the MP3 has the same headers like reading the mp3 directly.</p> <p>HTTP Headers from direct file access:</p> <pre><code>(Status-Line) HTTP/1.1 200 OK Date Mon, 31 May 2010 20:27:31 GMT Server Apache/2.2.9 Last-Modified Wed, 26 May 2010 13:39:19 GMT Etag "dac0039-41d91f8-4877f669cefc0" Accept-Ranges bytes Content-Length 50656162 Content-Range bytes 18390614-69046775/69046776 Keep-Alive timeout=15, max=100 Connection Keep-Alive Content-Type audio/mpeg </code></pre> <p>HTTP Header from my PHP script:</p> <pre><code>(Status-Line) HTTP/1.1 200 OK Date Mon, 31 May 2010 20:27:08 GMT Server Apache/2.2.9 Accept-Ranges bytes Content-Length 69046776 Keep-Alive timeout=15, max=100 Connection Keep-Alive Content-Type audio/mpeg </code></pre> <p>The only thing different it's the <strong>Content-Range</strong>, I even tried to add it, but if I use it the player will not work on my Ipod Touch. So I removed.</p> <p>Thank you very much.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload