我想创建一个本地视频文件的 Blob file:///home/user/NodeJS/Projects/project1/routes/../videosTrans/Node.js 初学者教程 - Node.js 介绍使用 Express2.js.mp4
我无法理解 Blob 的确切格式。我希望创建它以将其作为函数 createObjectURL() 的输入。 以下不起作用:
var URL = this.window.URL || this.window.webkitURL;
var file = new Blob(["file:///home/sanika/NodeJS/Projects/project1/routes/../videosTrans/Node.js tutorial for beginners - an introduction to Node.js with Express2.js.mp4"], "type" : "video\/mp4");
var value = URL.createObjectURL(file);
最佳答案
请使用blob的第二个参数作为对象。 所以你的代码应该是:
var URL = this.window.URL || this.window.webkitURL;
var file = new Blob(
["file:///home/sanika/NodeJS/Projects/project1/routes/../videosTrans/Node.js tutorial for beginners - an introduction to Node.js with Express2.js.mp4"],
{"type" : "video\/mp4"});
var value = URL.createObjectURL(file);
关于javascript - 如何创建视频文件的 blob,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26533691/