I have a react app which uses videos from firebase storage. I want to download them on button click. For this I use base64 and assign it to href of anchor tag which will be pressed. Problem is it works on windows but on safari downloaded video is muted and can not be unmuted. I opened video link on safari but it is muted as well.enter code here:
export default async function handler(req:NextApiRequest, res:NextApiResponse){
try{
let image = await axios.get(req.body.link, {responseType: 'arraybuffer'});
let raw = Buffer.from(image.data).toString('base64');
let mk = "data:" + 'video/mp4' + ";base64,"+raw;
res.json({message:mk}); //mk is assigned to href
}catch(e){
console.log(e);
res.json(e);
}
}