2014-10-23 13 views
5

Tôi muốn tạo Blob của tệp tệp video cục bộ: ///home/user/NodeJS/Projects/project1/routes/../videosTrans/Node.js hướng dẫn cho người mới bắt đầu - giới thiệu về Node.js với Express2.js.mp4Cách tạo blob của tệp video

Tôi không thể hiểu định dạng chính xác của Blob. Tôi muốn tạo nó để cho nó làm đầu vào cho hàm createObjectURL(). Các mục sau không hoạt động:

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

Xin chào, bạn có tìm cách để làm điều đó không? Tôi muốn làm tương tự – H4mm3R

Trả lời

1

Vui lòng sử dụng tham số thứ hai của blob làm đối tượng. để mã của bạn phải là:

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

Có thể chuyển đổi blob này thành webm không? –

Các vấn đề liên quan