diff --git a/.spelling b/.spelling index 7dbf6c2b..695cd09d 100644 --- a/.spelling +++ b/.spelling @@ -88,5 +88,7 @@ WebGPU Three.js PixiJS MediaStream +WHEP +livestream livestreaming broadcasted diff --git a/docs/livestreaming.mdx b/docs/livestreaming.mdx new file mode 100644 index 00000000..6cb1e5e9 --- /dev/null +++ b/docs/livestreaming.mdx @@ -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//room-manager?roomName=foo&peerName=bar&roomType=livestream +``` + +#### Using Server SDKs + + + + + ```ts + const createdRoom = await fishjamClient.createRoom({ roomType: 'livestream' }); + + const peer = await fishjamClient.createPeer(createdRoom.id) + ``` + + + + + + ```python + options = RoomOptions(room_type="livestream") + created_room = fishjam_client.create_room(options) + + peer = fishjam_client.create_peer(created_room.id) + ``` + + + + +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//room-manager//livestream-viewer-token +``` + +#### Using Server SDKs + + + + + ```ts + const viewerToken = await fishjamClient.createLivestreamViewerToken(room.id) + ``` + + + + + + ```python + viewer_token = fishjam_client.create_livestream_viewer_token(room.id) + ``` + + + + +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. +:::