hunk
V2EX  ›  问与答

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

  •  
  •   hunk · Mar 10, 2022 · 1495 views
    This topic created in 1595 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   ·   3127 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 13:34 · PVG 21:34 · LAX 06:34 · JFK 09:34
    ♥ Do have faith in what you're doing.