复制项目
This commit is contained in:
22
internal/rpc/chat/rtc.go
Normal file
22
internal/rpc/chat/rtc.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package chat
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"git.imall.cloud/openim/chat/pkg/common/mctx"
|
||||
"git.imall.cloud/openim/chat/pkg/protocol/chat"
|
||||
)
|
||||
|
||||
func (o *chatSvr) GetTokenForVideoMeeting(ctx context.Context, req *chat.GetTokenForVideoMeetingReq) (*chat.GetTokenForVideoMeetingResp, error) {
|
||||
if _, _, err := mctx.Check(ctx); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
token, err := o.Livekit.GetLiveKitToken(req.Room, req.Identity)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &chat.GetTokenForVideoMeetingResp{
|
||||
ServerUrl: o.Livekit.GetLiveKitURL(),
|
||||
Token: token,
|
||||
}, err
|
||||
}
|
||||
Reference in New Issue
Block a user