diff --git a/contribute-architecture.md b/contribute-architecture.md index ac61f6c725eb784009665f94244b68d5a9c4b896..b89a45605df1e1553d05e62888eb5803b737eaee 100644 --- a/contribute-architecture.md +++ b/contribute-architecture.md @@ -34,13 +34,11 @@ under [following servers](admin-following-instances). mode). - An instance cannot choose which other instances follow it, but it can decide to **reject all** followers. -- After having uploaded a video, the instance seeds it (WebSeed protocol). -- If a user wants to watch a video, they ask its instance the magnet URI and - the frontend adds the torrent (with WebTorrent), creates the HTML5 video - player and streams the file into it. -- A user watching a video seeds it too (BitTorrent). Thus, another user who is - watching the same video can get the data from the origin server and other - users watching it. +- After having uploaded a video the instance serves it via HTTPS, either directly or as a CDN in P2P protocols listed below. +- If a user wants to watch a video + - If using WebTorrent: the player retrieves the magnet URI for use with WebTorrent to retrieve the only media file, and download them over HTTP(S) from the source or rendundancy servers that are listed as [WebSeeds](http://bittorrent.org/beps/bep_0019.html). It sends media stream details and its connection details (ICE candidates) to WebTorrent trackers and obtains from them list of other peers that are downloading the same media stream, allowing P2P. It connects and starts to download the media file from the obtained peers as well as sharing already downloaded segments to them. + - If using HLS with P2P: their player will load the [M3U8 playlist](https://en.wikipedia.org/wiki/M3U#M3U8) that lists media segments and download them over HTTP(S) from the source or rendundancy servers. It sends media stream details and its connection details (ICE candidates) to WebTorrent trackers and obtains from them list of other peers that are downloading the same media stream, allowing P2P. It connects and starts to download media segments from the obtained peers as well as sharing already downloaded segments to them. +- A user watching a video _can_ seed it at the time (via [WebTorrent](https://webtorrent.io/) or [WebRTC](https://github.com/novage/p2p-media-loader) depending on their instance). This way, another user watching the same video can get the data from them and thus relieve the origin server. #### Communications between instances @@ -253,7 +251,9 @@ The client is a HTML/CSS/JavaScript web application (single page application -> * [SASS](http://sass-lang.com/) -> CSS framework * [Webpack](https://webpack.js.org/) -> Source builder (compile TypeScript, SASS files, bundle them...) * [Bootstrap](http://getbootstrap.com/) -> CSS framework - * [WebTorrent](https://webtorrent.io/) -> JavaScript library to make P2P in the browser + * [WebTorrent](https://webtorrent.io/) -> JavaScript library to make P2P in the browser (WebSeed) + * [WebTorrent](https://webtorrent.io/) -> JavaScript library to use P2P in the browser (via BitTorrent over WebRTC) + * [P2P Media Loader](https://github.com/novage/p2p-media-loader) - JavaScript library to use P2P in the browser (via HLS and BitTorrent over WebRTC) * [VideoJS](http://videojs.com/) -> JavaScript player framework