TheDiscordian / disco-chat

A peer-to-peer messaging app.
MIT License
22 stars 2 forks source link

Video streaming #33

Open 2color opened 1 year ago

2color commented 1 year ago

Background

As we discussed during our call, it would be nice to stream a video incrementally rather than wait for the full video to download.

Existing examples and knowledge

HLS

One of the advantages of HLS over some other streaming technologies is that the content can be hosted on a plain old web server without any special server-side support. The way this works is that the original content (the stream or video/audio file) is split up into small MPEG2-TS segments before being uploaded to the server. The segments are then fetched by the HLS player on the fly (using regular HTTP GET requests) and get spliced together to a continuous stream.

Example: https://github.com/ipfs-examples/js-ipfs-examples/tree/master/examples/browser-video-streaming

Using videostream

Another approach that works with mp4 video files is using the videostream library.

Example: https://github.com/ipfs-examples/js-ipfs-examples/tree/master/examples/browser-readablestream

TheDiscordian commented 1 year ago

videostream looks very cool, I'm a bit blown away by how easy it looks to use.