如何创build一个video文件的blob

我想创build一个本地video文件文件的Blob:///home/user/NodeJS/Projects/project1/routes/../videosTrans/Node.js教程初学者 – 介绍与Express2的Node.js。 js.mp4

我无法理解Blob的确切格式。 我希望创build它作为createObjectURL()函数的input。 以下不起作用:

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);