I almost looked for every possible source but is not satisfied or not found optimum way or path.

Actually i have to build a netflix clone (not exactly but a video on demand platform for one local client). The tech stack will be React at the frontend and DRF (Django Rest Framework) at the backend.

I know the node will match my purpose at best, but this needs to be done on DRF. How should I return the video, should I return it in bytes, packets and what can sample code look like, how frontend should fetch it. It will really help if you put your insight, in general. Thank you

  • 0
    well theres xhr or fetch. I assume because you're using react, the clients browser is newer, so fetch might be better.
  • 0
    @Wisecrack how to serve video from server, can i return it as normal ? i guess it will hamper user data? for ex. if video is of 1 gb should i return whole video ?
    or should i return whole video and fetch in step by step ?
  • 0
    @Sushrant if the video is 1gb, no I would not recommend returning the whole thing, only this is a frontend for *local* video files.

    If you're accessing remote video files, you're gonna want to stream them using say rmtp.

    frontend I'd use something like videojs which suppports hls and other streaming formats out of the box.

    but im really new so get a second opinion for sure.
  • 0
    @Wisecrack thank you again bro, if used technology like video js or something which support hls. Can i return whole file from backend and leave rest of the work for frontend to get that data in chunk form?
  • 0
    @Sushrant try it. see if videojs automatically retrieves in chunks. watch incoming data requests in chrome devtools.
Add Comment