├── app.py
├── static
│ └── demo.mp4
└── templates
└── index.html
from flask import Flask, render_template
app = Flask(__name__, static_folder='static')
@app.route('/')
def index():
return render_template('index.html')
<!DOCTYPE html>
<html>
<head>
<title>Video Example</title>
</head>
<body>
<h2>Serving video files from Flask template</h2>
<video width="320" height="240" controls>
<source src={{ url_for('static', filename="demo.mp4") }} type="video/mp4">
Your browser does not support the video tag.
</video>
</body>
</html>