Tag: marklogic

Node.js / Expressvideostream(HTTP 206部分内容)

我有一个数据库(MarkLogic)的二进制文件(MP4video文件)。 我正在使用数据库的Node.js API以块formsstream式传输文档。 设置看起来像这样: html文件 <video controls="controls" width="600"> <source src="/video/myvideo.mp4" type="video/mp4"> </video> 在expression式中,我设置了处理/ video /:parampath的路由(在数据库中,video具有唯一的标识符,即string'/video/myvideo.mp4') 的node.js // I'm only showing the relevant things in here const serveVideo = (req, res) => { var stream = db.documents.read('/gopro/malta.mp4').stream('chunked'); var chunks = []; var chunkBytes = 0; var start = 0; stream.on('data', (chunk) => { var headers; var […]