Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
249 views
in Technique[技术] by (71.8m points)

node.js - how to restrict blob url ( ie. video saved from the api response ) in a new window and only work in that curent window

i have a post api which gives video reponse, which iam saving to blob and created a url using URL.createObjectURL(blob) and giving that url to video src. but the problem is when i insepct it and copy the video blob url and open in a new window... its opening there also... which in my case should not happen.. how to restrict it..

        axios.get(URI, axiosOptions ).then(responce=>{
           
            if( responce.status == 200 ){
                const blob = new Blob([responce.data], {
                    type: "video/mp4"
                });
                setVideoBlob(blob);
                
                const videoURL = URL.createObjectURL(blob);
                console.log("video url is:", videoURL );
                setVideoUrl( videoURL );
                
            }

        }).catch(err=>{
           
            console.log(err.message);
            setErrormsg(err.message);
        });```
question from:https://stackoverflow.com/questions/65880958/how-to-restrict-blob-url-ie-video-saved-from-the-api-response-in-a-new-wind

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...