Play a downloaded video with flask [duplicate] Play a downloaded video with flask [duplicate] flask flask

Play a downloaded video with flask [duplicate]


I think you have something going on with file paths or file permissions.

  • Is the video being downloaded into static directory?
  • Is the static directory in the same directory, along with your main.py file?
  • Does your flask app have permissions to read the file?

I think the reason your file did not load in html template is because you referenced it as static/test.mp4 from an url - /done which translates the video path to be /done/static/test.mp4.

Instead of trying to push the file using Flask, you can redirect to the actual media file.

@app.route('/done')def done():    return redirect('/static/test.mp4')