express输出视频采用了fs.createReadStream可是却不能使用进度条进行视频节点选择

想要通过express输出本地视频,再前端使用video标签进行播放,可是输出的视频无法进行进度条操作,请问还有什么办法能够解决?或者还有什么办法能够输出视频?

app.get('/video/:id', function (req, res) {
  var time = new Date();
  res.writeHead(200, {'Content-Type': 'video/mp4'});
  var rs = fs.createReadStream('upload/' + req.params.id);
  rs.pipe(res);

  rs.on('end', function () {
      res.end();
      console.log('end call');
  });
});
阅读 2.9k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题