我想从MPMoviePlayer(例如:http://localhost/api?file_id=2313mk)从URL播放视频(MP4)文件,但无法让它工作,想知道是否有任何解决方案。MPMoviePlayer无法播放没有扩展名的URL的视频流
很少试验如下进行:
1)在计算机的浏览器Play网址:SUCCESS
2)在iPhone上播放URL(4.2+)的浏览器/ MPMoviePlayer:FAILED
3)复制文件和重命名,然后在iPhone浏览器中播放/ MPMoviePlayer从扩展新的URL(如:http://localhost/video.mp4):成功
4)检查头的内容类型(视频/ MP4):EXISTS
为无扩展URL响应头:(例如:HTTP://本地主机/ API的file_id = 2313mk)
HTTP/1.1 200 Download accepted Date: Tue, 29 Mar 2011 04:48:03 GMT Server: Apache Content-Transfer-Encoding: binary Content-Length: 24897567 Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Content-Type: video/mp4
与扩展URL响应头:(例如:HTTP://localhost/video.mp4 )
HTTP/1.1 200 OK Date: Tue, 29 Mar 2011 04:11:19 GMT Server: Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8l DAV/2 PHP/5.3.4 Last-Modified: Fri, 18 Mar 2011 05:38:16 GMT Etag: "d1b78c-17be81f-49ebb2f458200" Accept-Ranges: bytes Content-Length: 24897567 Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Type: video/mp4
它实际上适用于mp3格式,如果服务器的url(例如:http:// localhost/api?file_id = 2313mk)返回mp3 – alvinsj 2011-03-30 04:11:42