'How to override the fragment loader in react native video player for dash or Hls video

I'm developing an end to end encrypted community social network. For video in web I'm using a modified version of dash js.

In this version I've changed in the Fragment Loader the load and report functions. See here: https://docs.google.com/drawings/d/15Kn3gEHctmOs0tnI495RaImNNOU3l9_NWUYdC7AoHSY/edit

I'm using ffmpeg (ffmpeg wasm for the web) to convert the video to dash. Then encrypt the fragments in the client and send the encrypted fragments as normal file to the server.

To play a video I changed in the load function the url because I've a list which fragment name represents which file on the server, so the url is changed for loading this file.

In the report function I decrypt the file and return the decrypted result to dash js back. This works very fine in the browser.

But how I can do this in react native video player?

  1. Change the outgoing url
  2. decrypt the content from the server or rather use my decryption logic

I can't use normal DRM here because I'm using a different encryption and Clear Key is not supported on IOS.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source