Skip to content

Commit

Permalink
Clarify that host is expected to be a URL, not just host name. (#374)
Browse files Browse the repository at this point in the history
  • Loading branch information
bvanvugt authored Jan 7, 2024
1 parent ade5819 commit 12e24f8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ import (
)

func main() {
host := "host"
apiKey := "key"
apiSecret := "secret"
hostURL := "host-url" // ex: https://project-123456.livekit.cloud
apiKey := "api-key"
apiSecret := "api-secret"

roomName := "myroom"
identity := "participantIdentity"

roomClient := lksdk.NewRoomServiceClient(host, apiKey, apiSecret)
roomClient := lksdk.NewRoomServiceClient(hostURL, apiKey, apiSecret)

// create a new room
room, _ := roomClient.CreateRoom(context.Background(), &livekit.CreateRoomRequest{
Expand Down Expand Up @@ -106,7 +106,7 @@ import (
)

func main() {
host := "<host>"
hostURL := "host-url" // ex: https://project-123456.livekit.cloud
apiKey := "api-key"
apiSecret := "api-secret"
roomName := "myroom"
Expand All @@ -116,7 +116,7 @@ func main() {
OnTrackSubscribed: trackSubscribed
},
}
room, err := lksdk.ConnectToRoom(host, lksdk.ConnectInfo{
room, err := lksdk.ConnectToRoom(hostURL, lksdk.ConnectInfo{
APIKey: apiKey,
APISecret: apiSecret,
RoomName: roomName,
Expand Down Expand Up @@ -212,7 +212,7 @@ The SDK takes care of sending the samples to the room.

### Using a pacer

With video publishing, keyframes can be an order of magnitude larger than delta frames.
With video publishing, keyframes can be an order of magnitude larger than delta frames.
This size difference can cause a significant increase in bitrate when a keyframe is transmitted, leading to a surge in packet flow.
Such spikes might result in packet loss at the forwarding layer. To maintain a consistent packet flow,
you can enable the use of a [pacer](https://chromium.googlesource.com/external/webrtc/+/master/modules/pacing/g3doc/index.md).
Expand All @@ -227,7 +227,7 @@ pf := pacer.NewPacerFactory(
pacer.WithMaxLatency(time.Second),
)

room, err := lksdk.ConnectToRoom(host, lksdk.ConnectInfo{
room, err := lksdk.ConnectToRoom(hostURL, lksdk.ConnectInfo{
APIKey: apiKey,
APISecret: apiSecret,
RoomName: roomName,
Expand Down

0 comments on commit 12e24f8

Please sign in to comment.