Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 17419

Sending a video from the backend to the frontend then playing it with flask & react

$
0
0

After sending the video from the flask app to the front-end and trying to set the blob into a playable URL from the frontend it doesn't seem to accept the blob as a video source

@app.route('/summarize/<video_name>', methods=['GET'])def get_video(video_name):    return send_file(f"custom-video/{video_name}", mimetype='video/mp4')
const playVideo = async () => {    axios      .get(url, {        headers: {"Content-Type": "video/mp4",        },        responseType: "blob",      })      .then((response) => {        console.log(response);        const videoURL = URL.createObjectURL(response.data);        setVideoUrl(videoURL);      });  };

I've tried many times to send the video file to the frontend however the blob seems to be received fine but i cannot display it in the video playerresponse log1

i tried different mime types and also setting the blob url with different ways and still it doesnt work on chrome, firefox and edge


Viewing all articles
Browse latest Browse all 17419

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>