# Seedess Guide

Seedess can be used to stream your existing videos over Bittorrent and browser P2P transparently. You can also stream video from BitTorrent directly.

## P2P Streaming

Your existing videos can benefit greatly from transparent P2P streaming. Transparent P2P streaming allows viewers of your video to optimally share pieces of the video with each other while they watch - increasing the streaming capacity of your server and increasing video download speed.&#x20;

### Demo

To understand P2P streaming view the demo at <https://seedess.com/demo.html>

### Install Guide

At the moment we are working on releasing an open source transparent P2P video streaming library as well as a hosted solution.

For updates please register at [https://seedess.com/ ](<https://seedess.com/ >)

For now you try out the BitTorrent streaming API below.&#x20;

## Streaming directly from BitTorrent

To stream from BitTorrent in the browser all you need is a `torrentId`.&#x20;

A `torrentId` can be an `infoHash`, `magnet` or `.torrent` file.&#x20;

### Quick magnet example

To stream a magnet, add the `magnet` to the seedess player URL, `https://play.seedess.com/`

#### Example magnet

The following magnet is for an `mp4` video.

```
magnet:?xt=urn:btih:ab3f1350ebe4563a710545d0e33e09a7b7943ecf
```

#### Player URL &#x20;

The player URL loads the video player. You can generate a video player for any magnet by appending the magnet to the end of `https://play.seedess.com/`

Copy and paste the below player example to your browser URL.&#x20;

{% code title="Video Player URL" %}

```
https://play.seedess.com/magnet:?xt=urn:btih:ab3f1350ebe4563a710545d0e33e09a7b7943ecf
```

{% endcode %}

#### Player HTML Embed

The HTML embed can be embedded directly into you HTML page.&#x20;

{% code title="Video Player HTML Embed" %}

```markup
<iframe 
src="https://play.seedess.com/magnet:?xt=urn:btih:ab3f1350ebe4563a710545d0e33e09a7b7943ecf">
</iframe>
```

{% endcode %}

For more examples view the [BitTorrent Streaming](/bittorrent-streaming) section.


# BitTorrent Streaming

Seedess can stream video directly from BitTorrent

## Streaming from BitTorrent

To stream from BitTorrent in the browser all you need is a `torrentId`.&#x20;

A `torrentId` can be an `infoHash`, `magnet` or `.torrent` file.&#x20;

Any torrent can be streamed by appending the `torrentId` to the seedess player URL `https://play.seedess.com/`

### InfoHash Example

The infoHash `ab3f1350ebe4563a710545d0e33e09a7b7943ecf` can be streamed directly from BitTorrent

InfoHash

{% code title="InfoHash" %}

```
ab3f1350ebe4563a710545d0e33e09a7b7943ecf
```

{% endcode %}

#### Video Player URL

Add the infoHash to the end of `https://play.seedess.com/`

{% code title="Video Player URL" %}

```
https://play.seedess.com/ab3f1350ebe4563a710545d0e33e09a7b7943ecf
```

{% endcode %}

#### Video Player Embed

You can embed the player in your HTML webpage using an `<iframe>`

{% code title="VIdeo Player HTML Embed" %}

```markup
<iframe src="https://play.seedess.com/ab3f1350ebe4563a710545d0e33e09a7b7943ecf"></iframe>
```

{% endcode %}

### Magnet Example

#### Magnet

A magnet is in the form

{% code title="Magnet" %}

```
magnet:?xt=urn:btih:ab3f1350ebe4563a710545d0e33e09a7b7943ecf
```

{% endcode %}

#### Player URL &#x20;

Generate the Player URL from the magnet by appending the magnet to the seedess player URL.&#x20;

{% hint style="info" %}
Do not URL encode the magnet. Add it as is.
{% endhint %}

{% code title="Video Player URL" %}

```
https://play.seedess.com/magnet:?xt=urn:btih:ab3f1350ebe4563a710545d0e33e09a7b7943ecf
```

{% endcode %}

#### Player HTML Embed

The player embed HTML can be created by placing the player URL in an `<iframe>`

{% code title="Video Player HTML Embed" %}

```markup
<iframe 
src="https://play.seedess.com/magnet:?xt=urn:btih:ab3f1350ebe4563a710545d0e33e09a7b7943ecf">
</iframe>
```

{% endcode %}

### .torrent URL example

For the best performance, you will need a `.torrent` URL. Torrent URLs contain the metadata required to stream torrents and thus have a faster initial load time.&#x20;

{% hint style="info" %}
&#x20;The .torrent URL must have CORS enabled. Otherwise you will need to host the .torrent on your own server.
{% endhint %}

#### Torrent URL

Given a `.torrent URL` you can create the Video Player URL

{% code title="Torrent URL" %}

```
https://cdn.seedess.com/torrent/ab3f1350ebe4563a710545d0e33e09a7b7943ecf.torrent
```

{% endcode %}

#### Video Player URL

Create the Video Player URL by adding the torrent to the end of `http://play.seedess.com/`

{% hint style="info" %}
The .torrent file URL should not be URL encoded. Just paste it as is.
{% endhint %}

{% code title="Video Player URL" %}

```
https://play.seedess.com/https://cdn.seedess.com/torrent/ab3f1350ebe4563a710545d0e33e09a7b7943ecf.torrent
```

{% endcode %}

#### Video Player Embed

The Player Embed code can create by using the URL as the src of your iframe

{% code title="Video Player Embed HTML" %}

```markup
<iframe 
src="https://play.seedess.com/
https://cdn.torcdn.com/torrent/ab3f1350ebe4563a710545d0e33e09a7b7943ecf.torrent
"></iframe>
```

{% endcode %}

### Combined BitTorrent Streaming

Streaming from Bittorrent doesn't give you much advantage if you don't use it to augment your existing HTTP Streaming or CDN.&#x20;

Let's combine Bittorrent Streaming with a CDN

#### Magnet

First we need a magnet

{% code title="Magnet" %}

```
magnet:?xt=urn:btih:ab3f1350ebe4563a710545d0e33e09a7b7943ecf
```

{% endcode %}

#### CDN URL

Then we need the URL of the video on different CDNs

{% code title="Fast Cast Video URL" %}

```
https%3A%2F%2Ffastcast.nz%2Fdownloads%2Fawakening-new-zealand-4k.mp4
```

{% endcode %}

{% code title="BTorrent Video URL" %}

```
https%3A%2F%2Fwebseed.btorrent.xyz%2Fawakening-new-zealand-4k.mp4
```

{% endcode %}

We can add other CDN URLs such as Amazon and Cloudflare URLs.&#x20;

We add the URLs to the video player URL using a parameter `ws` which stands for WebSeed. This is a BitTorrent term for a CDN or URL that hosts the video.&#x20;

{% hint style="info" %}
Please note the URLs are URL Encoded as they are parameters to the magnet URL and looks like `&ws={encoded URL}`.&#x20;
{% endhint %}

We can add as many `ws` parameter as we want, however it's good to keep it under 4 URLs for performance reasons.&#x20;

{% code title="Video Player URL" %}

```
https://play.seedess.com/magnet:?xt=urn:btih:ab3f1350ebe4563a710545d0e33e09a7b7943ecf&ws=https%3A%2F%2Ffastcast.nz%2Fdownloads%2Fawakening-new-zealand-4k.mp4&ws=https%3A%2F%2Fwebseed.btorrent.xyz%2Fawakening-new-zealand-4k.mp4
```

{% endcode %}

#### Video Player Embed

The video player embed uses wraps the player in an Iframe

{% code title="Video Player HTML Embed" %}

```markup
https://play.seedess.com/magnet:?xt=urn:btih:ab3f1350ebe4563a710545d0e33e09a7b7943ecf&ws=https%3A%2F%2Ffastcast.nz%2Fdownloads%2Fawakening-new-zealand-4k.mp4&ws=https%3A%2F%2Fwebseed.btorrent.xyz%2Fawakening-new-zealand-4k.mp4
```

{% endcode %}


# Peer to Peer Streaming

Transparent P2P streaming allows you to stream your existing videos over Peer to Peer without any changes to your infrastructure, streaming provider, or  video HTML and JavaScript.

## Installing P2P Streaming

We are currently working on an open source API.&#x20;

You may request update notifications by registering at [`https://seedess.com/`](https://seedess.com/)&#x20;

For now use the [BitTorrent Streaming API](/bittorrent-streaming).&#x20;

{% hint style="info" %}
&#x20;The P2P streaming creates multiple streams from viewers while keeping your CDN and hosting video streams. It will use the fastest stream and patch the video live to give you the fastest streaming results.&#x20;
{% endhint %}

You can view a [demo](https://seedess.com/demo.html) of our BitTorrent streaming which will is what our P2P streaming is based on.&#x20;


