预览音乐可拖动进度条

This commit is contained in:
ckcz123 committed 2020-05-17 17:04:41 +08:00
1 parent 1feccfc185
commit a62e0119fd
5 files changed
+37 -12

No files matched your search

+4 -1
View File
@@ -67,7 +67,10 @@ def static_file(path):
if not os.path.isfile(path):
abort(404)
return None
return Response(get_file(path), mimetype = get_mimetype(path))
mimetype = get_mimetype(path)
response = Response(get_file(path), mimetype = mimetype)
if mimetype.startswith('audio/'): response.headers["Accept-Ranges"] = "bytes"
return response
def process_request():
data = request.get_data() # str in py2 and bytes in py3