I have a website where the user can access a video that is saved in my bucket on Google Cloud Storage with the signedUrl, but the video has the Download option:
and I don't want to allow this button, I want the video to be just for preview. How can I do this? I didn't find anything in the GCS documentation (https://googleapis.dev/nodejs/storage/latest/index.html).
I'm using NodeJs for the back end and I'm creating the signedUrl like this:
var expiry = new Date(Date.now() + 120000);
const file = bucket.file(req.file.cloudStorageObject);
const config = {
action: "read",
expires: expiry
};
file.getSignedUrl(config, function(err, url) {
if (err) {
console.error(err);
return;
}
// The file is now available to read from this URL.
request(url, function(err, resp) {
console.log(444444, url);
});
});
res.send(200);