hunk
V2EX  ›  问与答

react 下如何读取文件(arrarybuffer)给 video 控件播放?

  •  
  •   hunk · Mar 10, 2022 · 1418 views
    This topic created in 1556 days ago, the information mentioned may be changed or developed.
    react 下,想把读取文件的 arrarybuffer 给 video 控件播放,下面代码不成功,有用过的朋友吗?
    const blob = new Blob([data]);
    const src = URL.createObjectURL(data);
    const video = videoRef.current;
    video.src = src;
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1051 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 23:02 · PVG 07:02 · LAX 16:02 · JFK 19:02
    ♥ Do have faith in what you're doing.