Tôi chia sẻ tệp trong một thư mục với các thiết bị khác bằng cách gọi một máy chủ sử dụng python -m SimpleHTTPServer
.Phát âm thanh/Video không thành công bằng SimpleHTTPServer
Tôi chỉ cố gắng để stream video/audio (tiêu chuẩn mp4 & mp3, cả dưới 20MB) để máy tính khác sử dụng & này nó TRÌNH (nhưng bằng cách ném các lỗi (niêm yết xuống) tại nhà ga).
Bằng cách nào đó, video/âm thanh bị lỗi (ngoại trừ các tệp mp3 rất nhỏ) để phát bằng Safari trong iPhone/iPad. Nó chắc chắn không liên quan đến các tập tin media, khi tôi truyền chúng thành công bằng cách sử dụng Apache trong iPhone.
Bất kỳ ý tưởng nào tại sao nó xảy ra?
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
Xem các [lựa chọn thay thế] này (http://stackoverflow.com/questions/12905426/faster-alternative-to-pythons-simplehttpserver) với mô-đun SimpleHTTPServer của Python. – mtadd