Serving mp3s via PHP to mobile devices -


i have simple php script serves mp3 file browser. works on desktop browsers, unfortunately doesn't play on of mobile devices i've tested (android phone, ipad mini). can see i'm missing?

<?php     $file = 'track.mp3';      header('content-type: audio/mpeg');     header('content-length: ' . filesize($file));     header('cache-control: public, must-revalidate, max-age=0');     header('pragma: no-cache');     header('content-disposition: inline; filename=track.mp3');     header('content-transfer-encoding: binary');      readfile($file);     exit; ?> 

please note: i'm aware pointless in , of itself; simplified version of larger application, i've stripped out rest of code provide simplest reproducer can.

thanks lot help!


Comments

Popular posts from this blog

python 3 IndexError: list index out of range -

android - How to save instance state of selected radiobutton on menu -

IF statement in MySQL trigger -