Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Django模板中的HTML5音频标记在Safari中无法正常工作_Django_Safari_Http Headers_Html5 Audio - Fatal编程技术网

Django模板中的HTML5音频标记在Safari中无法正常工作

Django模板中的HTML5音频标记在Safari中无法正常工作,django,safari,http-headers,html5-audio,Django,Safari,Http Headers,Html5 Audio,我在一些本地文件夹中创建了simple index.html文件,其中包含以下内容: <!DOCTYPE html> <html> <head> <title></title> </head> <body> <audio controls> <source src="example.mp3" type="audio/mpeg"> </audio

我在一些本地文件夹中创建了simple index.html文件,其中包含以下内容:

<!DOCTYPE html>
<html>
<head>
    <title></title>
</head>
<body>
    <audio controls>
        <source src="example.mp3" type="audio/mpeg">
    </audio>
</body>
</html>
我得到:

它工作-音频播放,但没有进度条,剩余时间等

所以,唯一的区别是,SafariVia Django并不确定音频文件的持续时间,而是将其视为直播。我想应该在某个地方传递一些http头,但这只是猜测


Django在
DEBUG=True

在Chrome、FF和Opera(本地和django文件)中一切正常


Safari版本:10.1.1(目前最新版本)


Django版本:1.11.1(目前最新版本)

好吧,没有像
Django html元素这样的东西。我在Django遇到了一些问题,比如视频和音频等流式静态内容。一旦部署nginx服务器来处理静态文件,这些问题似乎就消失了。如果它在生产中看起来不错的话,那其实没什么大不了的。
url(r'^$', TemplateView.as_view(template_name='base.html'), name='base'),