我正在开发Cordova的移动应用程序。我已下载视频并将其存储在客户端设备中。
我需要存储加密的视频文件,以便客户端无法传播视频。当用户正在播放视频时,应用应该动态解密视频。这些文件很大,有没有办法像YouTube一样加密文件,并相应解密?
var videocreateFileSource1 = offlineRootDirectory+"/video/sess12.mp4";
var inputUri=encodeURI("http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_50mb.mp4");
var outputPath = videocreateFileSource1;
fileTransfer.onprogress = function(result){
var percent = result.loaded / result.total * 100;
percent = Math.round(percent);
console.log('Downloaded: ' + percent + '%');
};
};
fileTransfer.download(
inputUri,
outputPath,
function (entry) {
console.log("completed the video and store into device");
},
function (error) {
console.log("download error: source=" + error.source + ", target=" + error.target + ", error code=" + error.code);
});