I am currently working on a cross-platform mobile application where I am facing an issue with downloading videos from YouTube. When I use the file-transfer plugin to download a video by passing the URL, it only downloads 40 to 50 KB and shows a complete status. I need assistance from someone who can help me successfully download videos from YouTube.
var fileTransfer = new FileTransfer();
var inputUri = encodeURI("https://www.youtube.com/watch?v=iQbBBOL2BBE");
var outputPath = videocreateFileSource1;
fileTransfer.download(
inputUri,
outputPath,
function (entry) {
},
function (error) {
alert("download error: source=" + error.source + ", target=" + error.target + ", error code=" + error.code);
}
);