package main
import(
livepeergo "github.com/livepeer/livepeer-go"
"context"
"github.com/livepeer/livepeer-go/models/components"
"log"
)
func main() {
s := livepeergo.New(
livepeergo.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
)
ctx := context.Background()
res, err := s.Room.CreateUser(ctx, "<id>", components.RoomUserPayload{
Name: "name",
CanPublish: livepeergo.Bool(true),
CanPublishData: livepeergo.Bool(true),
})
if err != nil {
log.Fatal(err)
}
if res.RoomUserResponse != nil {
// handle response
}
}{
"id": "d32ae9e6-c459-4931-9898-e86e2f5e7e16",
"joinUrl": "https://meet.livepeer.chat",
"token": "token"
}Livepeer point d’extrémité de l’API Studio
package main
import(
livepeergo "github.com/livepeer/livepeer-go"
"context"
"github.com/livepeer/livepeer-go/models/components"
"log"
)
func main() {
s := livepeergo.New(
livepeergo.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
)
ctx := context.Background()
res, err := s.Room.CreateUser(ctx, "<id>", components.RoomUserPayload{
Name: "name",
CanPublish: livepeergo.Bool(true),
CanPublishData: livepeergo.Bool(true),
})
if err != nil {
log.Fatal(err)
}
if res.RoomUserResponse != nil {
// handle response
}
}{
"id": "d32ae9e6-c459-4931-9898-e86e2f5e7e16",
"joinUrl": "https://meet.livepeer.chat",
"token": "token"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Success
The ID of the user
"d32ae9e6-c459-4931-9898-e86e2f5e7e16"
Joining URL - use this for Livepeer's default meeting app (see the multiparticipant streaming guide for more info).
"https://meet.livepeer.chat"
Joining JWT - this can be used if you have a custom meeting app (see the multiparticipant streaming guide for more info).
"token"
Cette page vous a-t-elle été utile ?