diff --git a/docusaurus/video/docusaurus/docs/api/_common_/rtmp.mdx b/docusaurus/video/docusaurus/docs/api/_common_/rtmp.mdx index e113ced2..fe2cd911 100644 --- a/docusaurus/video/docusaurus/docs/api/_common_/rtmp.mdx +++ b/docusaurus/video/docusaurus/docs/api/_common_/rtmp.mdx @@ -39,6 +39,31 @@ rtmp_url = response.data.call.ingress.rtmp.address print(rtmp_url, stream_key) ``` + + + +```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) +``` +