Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .spelling
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,7 @@ WebGPU
Three.js
PixiJS
MediaStream
WHEP
livestream
livestreaming
broadcasted
91 changes: 91 additions & 0 deletions docs/livestreaming.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---
sidebar_position: 5
---

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

# Livestreaming

If your case involves streaming live audio and/or video from one source to many viewers with low latency, Fishjam provides the exact tools you need. This scenario is 20% cheaper than videoconferencing.

## How Do I Use It?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick (blocking):

Suggested change
## How Do I Use It?
## How do I use it?


### Streamer

First, you need to create a room with the livestream type using our [Server SDKs](/production/server). If you are using our sandbox, the [Room Manager](/room-manager) also allows you to create such a room. As the streaming is one-to-many, you can have only one streaming participant in that room.

#### Using Room Manager

You can create a livestream room and obtain a peer token using this URL:

```
https://fishjam.io/api/v1/connect/<YOUR_APP_UUID>/room-manager?roomName=foo&peerName=bar&roomType=livestream
```

#### Using Server SDKs

<Tabs groupId="language">
<TabItem value="ts" label="Typescript">

```ts
const createdRoom = await fishjamClient.createRoom({ roomType: 'livestream' });

const peer = await fishjamClient.createPeer(createdRoom.id)
```

</TabItem>

<TabItem value="python" label="Python">

```python
options = RoomOptions(room_type="livestream")
created_room = fishjam_client.create_room(options)

peer = fishjam_client.create_peer(created_room.id)
```

</TabItem>
</Tabs>

Now, you can connect to the room and start streaming as described in our [React Native](/react-native/connecting) and [React](/react/connecting) docs.

:::info
The livestream rooms support only one video and audio track; any additional tracks will be ignored and will not be available to the viewers.
:::

### Viewers

To view the streamed content, you need to obtain a viewer token that can be generated using [Server SDKs](/production/server). If you are using our sandbox, the [Room Manager](/room-manager) also allows you to create such a token.

#### Using Room Manager

```
https://fishjam.io/api/v1/connect/<YOUR_APP_UUID>/room-manager/<ROOM_NAME>/livestream-viewer-token
```

#### Using Server SDKs

<Tabs groupId="language">
<TabItem value="ts" label="Typescript">

```ts
const viewerToken = await fishjamClient.createLivestreamViewerToken(room.id)
```

</TabItem>

<TabItem value="python" label="Python">

```python
viewer_token = fishjam_client.create_livestream_viewer_token(room.id)
```

</TabItem>
</Tabs>

Now you can connect the viewer to the livestream as described in our React Native and [React](/react/livestreaming) docs.

:::info
Viewers connect using [WHEP](https://blog.swmansion.com/introducing-react-native-whip-whep-ac9e5588d4da) standard, allowing the use of any player that supports the WHEP standard.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (blocking): I would link to something different here, and specify that there is React Native whip/whep for the mobile ecosystem.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something different... like RFC?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something like our article would be the best, but it's yet to be created :p

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo lets not waste time here and approach this incrementally

:::