How should I go about streaming large local video files in React?

Viewed 142

I've recently taken up leaning some more JS and started working on a video player using React.But I am stumped on this issue I am having; I can not import files larger than 2gb and I cannot find any information on streaming the files from local directories, every doc I find either uses smaller than 2gb files, or uses remote files, like a w3.org link.

How should I go about streaming said files. Should I be using HLS, DASH, or something else? As an example:

import video from './content/filename.mp4';

This will throw the error saying:

RangeError [ERR_FS_FILE_TOO_LARGE]: File size (filesize) is greater than 2 GB

Making it impossible for me to playback in the default video player or something like video-react or videojs. The one solution I can think up is splitting the files into chunks, but I can't seem to find any reliable ways to do that.

In normal html and js, the same files load normally (I dynamically load the src based on the query parameters) and play in the default video player, so I assume this is a Webpack limit to avoid crashing the browser.

Thanks in advance!

0 Answers
Related