Hello again Glen
I did look at the above, but I struggled to understand what to put in the bytesIO bit.
Having looked around a bit more, I used this which works fine:-
@app.route('/', methods=['GET', 'POST'])
def watch():
return send_file('Cam1 12.03.41 07-06-2022.mp4')
But, I don't know how to reference the path to file if its not in the root directory. I assumed say "/videos/" but it doesn't work.
The other thing is, as soon as I put the login form on the same route, the video wont play. As in, it looks like its working but the video length is zero and the play button is greyed out:-
@app.route('/', methods=['GET', 'POST'])
def login():
error = None
if request.method == 'POST':
if request.form['username'] != 'admin' or request.form['password'] != 'admin':
error = 'Invalid Credentials. Please try again.'
else:
return send_file('Cam1 12.03.41 07-06-2022.mp4')
return render_template('login.html', error=error)
If you could just point me in the right direction for any of the above I would be vvv grateful.
Kind regards
Paul