我正在使用django从服务器流式传输视频,一切都很好,但是当视频流传输时我重新加载视频页面时,出现此错误:ConnectionResetError:[Errno 104]对等连接重置 所以我做错了吗?
models.py
class VideoUpload(models.Model):
Video_Description = models.CharField(max_length=500)
slug = models.SlugField(unique=True)
Video = models.FileField(upload_to='videos/%Y/%m/%d/', null=True, verbose_name="")
timestamp = models.DateTimeField(auto_now_add=True)
观看次数
def render_video(request):
video = VideoUpload.objects.last()
return render(request,'stream_dj/video.html',{'video':video})
html
<video name='demo' controls autoplay width='50%' height='40%'>
<source src="{{video.Video.url}}" type="video/mp4"/>
</video>
</body>