我有一个flask服务器,里面有一个视频文件。如何使用HTML <video>
标记让用户观看视频?在服务器中,我有send_file
:
@app.route("/movie")
def movie():
return send_file("Images/i0.mov")
然后,在HTML中,我有:
<video width="90" height="90" controls>
<source src="/movie" type="video/quicktime">
Uh oh! Your browser doesn't support the <code>video</code> tag.
</video>
但是,没有视频播放,我也没有收到Uh oh!
消息。我做错了什么
这就是我得到的:
<html>
<video width="90" height="90" controls>
<source src="/movie" type="video/quicktime">
Uh oh! Your browser doesn't support the <code>video</code> tag.
</video>
<br><br>
It just doesn't load!
</html>
根据我的经验,
send_file
是从烧瓶下载一个文件。我有一个类似的例子,我将视频文件名作为变量传递为添加url_并在HTML文件中传递该文件
以及后端
相关问题 更多 >
编程相关推荐