I'm working on a personal project and I want to stream a video hosted on a platform (like Youtube) through the app server and to the client (VideoServer --> MyApp --> Client). The following function is the one I am using to do so, and it's working OK. I get the video streamed through my server to the client, but on the client I'm not able to navigate through the time bar of the video. I can't go forward and backwards on it. When I try to do so, the video jumps to the very beggining of it.
I have made some research and I can't seem to find anything useful for this. I found this other question but it is using a local file instead of a file hosted on a remote server. I tried to set up something similar on my code but I can't get it to work. I think that the way of doing it should be similar to the solution of that question but I'm not really sure as I never worked with video streams before.
@app.route('/stream', methods=['GET'])
@login_required
def stream():
id = request.args.get('v', None) # Get the video ID.
url = getVideoUrl(id) # Get the video stream url.
req = requests.get(url, stream = True)
return Response(req.iter_content(chunk_size=10*1024), mimetype=req.headers['Content-Type'], content_type=req.headers['Content-Type'], direct_passthrough=True)