I have checked access log of my server and found that each time I access the stream.php, ipod touch safari will access the file twice. The user agent of first access is "Apple iPhone" and the second access is "iPod Safari"...
Code: Select all
xxx.xxx.xxx.xxx - - [14/Oct/2007:04:10:53 +0800] "GET /ipod/stream.php HTTP/1.1" 200 16384 "-" "Apple iPhone v1.1.1 CoreMedia v1.0.0.3A110a"
xxx.xxx.xxx.xxx- - [14/Oct/2007:04:10:52 +0800] "GET /ipod/stream.php HTTP/1.1" 200 270336 "-" "Mozilla/5.0 (iPod; U; CPU like Mac OS X; ja-jp) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3A110a Safari/419.3"
The amount of data logged in access log is not the same of the file. Seems it stopped to transfer data suddenly.
I have also tried to change the reading method from fread() to readfile(), so that the file will not transfer in segment. Now the amount of data logged in the access log is same as the mp4 file size, but iPod touch still cannot playback the file. The access log is like this :
Code: Select all
xxx.xxx.xxx.xxx- - [14/Oct/2007:04:24:17 +0800] "GET /ipod/stream.php HTTP/1.1" 200 5027707 "-" "Apple iPhone v1.1.1 CoreMedia v1.0.0.3A110a"
xxx.xxx.xxx.xxx- - [14/Oct/2007:04:24:17 +0800] "GET /ipod/stream.php HTTP/1.1" 200 5027707 "-" "Mozilla/5.0 (iPod; U; CPU like Mac OS X; ja-jp) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3A110a Safari/419.3"
P.S. the sequence of 2 accesses are not always in the same order.