Skip to content

Commit

Permalink
rtmp
Browse files Browse the repository at this point in the history
  • Loading branch information
sachaarbonel committed Sep 18, 2024
1 parent c8fd111 commit c835046
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docusaurus/video/docusaurus/docs/api/_common_/rtmp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,31 @@ rtmp_url = response.data.call.ingress.rtmp.address
print(rtmp_url, stream_key)
```

</TabItem>
<TabItem value="go" label="Golang">

```go
call := client.Video().Call("default", uuid.New().String())
// create the call where the RTMP will be sent to
response, err := call.GetOrCreate(ctx, nil)

// ensure we have a user for the host to send video via RTMP
client.UpdateUsers(ctx, &UpdateUsersRequest{
Users: map[string]UserRequest{
"tommaso-the-host": {
ID: "tommaso-the-host",
},
},
})

// create a token for the user sending video, this can be used as the stream key
expiration := time.Now().Add(1 * time.Hour)
streamKey, err := client.CreateToken("tommaso-the-host", &StreamJWTClaims{Expire: &expiration})

rtmpURL := response.Data.Call.Ingress.Rtmp.Address
fmt.Println("RTMP URL:", rtmpURL, "Stream Key:", streamKey)
```

</TabItem>
<TabItem value="curl" label="cURL">

Expand Down

0 comments on commit c835046

Please sign in to comment.