使用SimpleHTTPServer的音频/视频流传输失败

我通过使用python -m SimpleHTTPServer调用服务器来将文件夹中的文件共享给其他设备.

我只是尝试将视频/音频(标准mp4和mp3都在20MB以下)流式传输到使用此&它起作用(但是通过在终端中抛出错误(列出来)).

不知何故,视频/音频(非常小的mp3文件除外)无法在iPhone / iPad中与Safari一起播放.它绝对与媒体文件无关,因为我在iPhone中使用Apache成功地对它们进行了流传输.

知道为什么会发生吗?

Exception happened during processing of request from ('192.168.1.2', 51775)
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 284, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 310, in process_request
    self.finish_request(request, client_address)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 323, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 641, in __init__
    self.finish()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 694, in finish
    self.wfile.flush()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 303, in flush
    self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe

解决方法:

如建议,请使用python替代品What is a faster alternative to Python’s http.server (or SimpleHTTPServer)?或完全使用完整的网络服务.快速谷歌建议Mac支持Nignx和Apache2.

上一篇:Spark与Flink对比


下一篇:SparkStreaming(一)——概述