var filesArray = [file];
if (navigator.canShare && navigator.canShare({ files: filesArray })) {
navigator
.share({
title: "Hello👋",
text:"My Text" ,
url: "",
files: filesArray,
})
.then(() => console.log("Successful share"))
.catch((error) => console.log("Error in sharing", error));
} else {
console.log(`system does not support sharing files.`);
}
};
I want to send video too. If the filetype is .mp4, then it will be sended as "video.mp4" instead of "image.jpg. Anyone have a clue how to get over it? How to have conditions for that