-
Notifications
You must be signed in to change notification settings - Fork 3
Add serverside livestreaming docs #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -88,5 +88,7 @@ WebGPU | |
| Three.js | ||
| PixiJS | ||
| MediaStream | ||
| WHEP | ||
| livestream | ||
| livestreaming | ||
| broadcasted | ||
| 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? | ||
|
|
||
| ### 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. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. something different... like RFC?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. imo lets not waste time here and approach this incrementally |
||
| ::: | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick (blocking):