HTTP Streaming Server适用于iPhone,在iPad上运行失败;苹果浏览器

时间:2011-12-30 18:34:45

标签: ios http audio-streaming http-streaming

我正在试图找出HTTP Streaming Server。我有一个测试播放列表在Apache22上工作,使用mp3音频文件:

http://atkin.identry.com/mp3/

这个播放列表适用于我的iPhone 4s,但不适用于我的iPad,即使它运行相同版本的iOS 5,或运行Lion的iMac运行Safari。

对于iPad,Apache日志显示获取的播放列表,但没有其他内容:

75.127.142.66 - - [30/Dec/2011:13:24:19 -0500] "GET /mp3/playlist.m3u8 HTTP/1.1" 304 - "-" "AppleCoreMedia/1.0.0.9A405 (iPad; U; CPU OS 5_0_1 like Mac OS X; en_us)"
75.127.142.66 - - [30/Dec/2011:13:24:20 -0500] "GET /mp3/playlist.m3u8 HTTP/1.1" 206 126 "-" "AppleCoreMedia/1.0.0.9A405 (iPad; U; CPU OS 5_0_1 like Mac OS X; en_us)"

使用iPhone,可以获取播放列表,然后获取音频文件,如您所愿:

75.127.142.66 - - [30/Dec/2011:13:26:31 -0500] "GET /mp3/playlist.m3u8 HTTP/1.1" 206 2 "-" "AppleCoreMedia/1.0.0.9A405 (iPhone; U; CPU OS 5_0_1 like Mac OS X; en_us)"
75.127.142.66 - - [30/Dec/2011:13:26:31 -0500] "GET /mp3/playlist.m3u8 HTTP/1.1" 206 126 "-" "AppleCoreMedia/1.0.0.9A405 (iPhone; U; CPU OS 5_0_1 like Mac OS X; en_us)"
75.127.142.66 - - [30/Dec/2011:13:26:35 -0500] "GET /mp3/playlist.m3u8 HTTP/1.1" 304 - "-" "AppleCoreMedia/1.0.0.9A405 (iPhone; U; CPU OS 5_0_1 like Mac OS X; en_us)"
75.127.142.66 - - [30/Dec/2011:13:26:35 -0500] "GET /mp3/playlist.m3u8 HTTP/1.1" 206 126 "-" "AppleCoreMedia/1.0.0.9A405 (iPhone; U; CPU OS 5_0_1 like Mac OS X; en_us)"
75.127.142.66 - - [30/Dec/2011:13:26:35 -0500] "GET /mp3/playlist.m3u8 HTTP/1.1" 200 126 "-" "AppleCoreMedia/1.0.0.9A405 (iPhone; U; CPU OS 5_0_1 like Mac OS X; en_us)"
75.127.142.66 - - [30/Dec/2011:13:26:35 -0500] "GET /mp3/1.mp3 HTTP/1.1" 200 366464 "-" "AppleCoreMedia/1.0.0.9A405 (iPhone; U; CPU OS 5_0_1 like Mac OS X; en_us)"
75.127.142.66 - - [30/Dec/2011:13:26:36 -0500] "GET /mp3/2.mp3 HTTP/1.1" 200 375865 "-" "AppleCoreMedia/1.0.0.9A405 (iPhone; U; CPU OS 5_0_1 like Mac OS X; en_us)"
75.127.142.66 - - [30/Dec/2011:13:26:36 -0500] "GET /mp3/3.mp3 HTTP/1.1" 200 316303 "-" "AppleCoreMedia/1.0.0.9A405 (iPhone; U; CPU OS 5_0_1 like Mac OS X; en_us)"

对于Safari,提取播放列表和音频文件,与iPhone相同,但网页上不显示任何内容,也不播放任何声音。

这是播放列表:

#EXTM3U
#EXT-X-TARGETDURATION:44
#EXT-X-MEDIA-SEQUENCE:1
#EXTINF:15,
1.mp3
#EXTINF:16,
2.mp3
#EXTINF:13,
3.mp3
#EXT-X-ENDLIST

非常简单......很难看出我在哪里出错了,但显然我有。

我知道这是一个非常深奥的主题,但如果有人有想法,我很乐意听到它。

由于

1 个答案:

答案 0 :(得分:0)

好的,我明白了。它不在播放列表文件或音频文件中,而是在索引文件中,我认为这很简单,不值得列出。

问题出在视频标记中。我错误地使用了一些Web教程中的示例,标签设置如下:

  <video src="./playlist.m3u8" height="300" width="400" ></video>

这在iPad或Safari上无效。将其更改为可在iPad上运行,但不适用于Safari:

  <video src="playlist.m3u8" height="300" width="400" ></video>

据我所知,这些网址是等效的,但是......

最后,将其更改为使其适用于所有平台:

 <video src="playlist.m3u8" width="320" height="40" controls="controls"     autoplay="autoplay" >Your browser does not support the video tag</video>

现在我需要播放m4a文件...