一千萬個為什麽

搜索

是否可以通過JavaScript修改視頻流

For my goals I'm using html5 and tag < video> to add a media content to page. I've found how to control video by JavaScript(stop, play, load). But is there any ways to modify processing video stream.

我正在嘗試找到如何將我的字節序列添加到下載流中的解決方案:例如在播放之前修改文件頭。

謝謝

最佳答案

沒有用於修改 video 元素中的視頻流字節的API。

您可以:

  • Draw the current frame of the video element on canvas
  • Apply an SVG filter to the video element (in Gecko)
  • Use vendor-specific XMLHttpRequest extensions to read the bytes of the video file in JavaScript, modify the data, construct a data: URL from the data and load the data: URL into the video element.

轉載註明原文: 是否可以通過JavaScript修改視頻流