How to create a blob video file

I would like to create a local video file blob file: ///home/user/NodeJS/Projects/project1/routes/../videosTrans/ Node.js primer - introduction to Node.js with Express2.js.mp4

I could not understand the exact format of Blob. I want to create it for input as a function of the createObjectURL () function. The following does not work:

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); 
+5
source share
1 answer

Please use the second blob parameter as an object. so your code should be:

 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); 
+1
source

Source: https://habr.com/ru/post/1205380/


All Articles