Try this -
function shareVideoToWhatsApp(videoPath) {
if (!app.FileExists(videoPath)) {
alert("File not found: " + videoPath);
return;
}
var contentUri = app.Path2Uri(videoPath);
var extras = JSON.stringify([
{
name: "android.intent.extra.STREAM",
type: "uri",
value: contentUri
}
]);
app.SendIntent(
"com.whatsapp",
null,
"android.intent.action.SEND",
null,
null,
"video/mp4",
extras
);
}
shareVideoToWhatsApp("a.mp4");