k-yle / rtsp-relay

📽 View an RTSP stream in your web browser using an express.js server
https://npm.im/rtsp-relay
MIT License
334 stars 60 forks source link

Making available offline #123

Open kyeshmz opened 3 years ago

kyeshmz commented 3 years ago

Hi! Thanks for the great library @k-yle I have a use case that involves using the browser while being offline. It would be great if we could include the original jsmpeg library as a dependency so that it doesn't look for the CDN and fail when offline.

Currently I use a work around where I just have the original minified jsmpeg source in a separate js file as browser file checks if it is avaliable.

     if (window.JSMpeg) {
        resolve(); // already loaded
        return;
      }
k-yle commented 3 years ago

Hi @kyeshmz, jsmpeg isn't available on npm so we can't easily bundle it, besides from copy-pasting the js file. This is something we should consider though.

For now, if you want to use a local copy of jsmpeg, you can load it using <script src="./path/to/jsmpeg.js"></script>. As you've discovered, rtsp-relay is designed to use the version of jsmpeg that you've loaded yourself.

kyeshmz commented 3 years ago

I was thinking of just adding it as a git submodule or something like that and like to the github avaliable