hunk
V2EX  ›  问与答

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

  •  
  •   hunk · Mar 10, 2022 · 1417 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   ·   894 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 20:58 · PVG 04:58 · LAX 13:58 · JFK 16:58
    ♥ Do have faith in what you're doing.