Files
open-im-server/internal/msg_gateway/gate/open_im_media/room.go
T

51 lines
1.1 KiB
Go
Raw Normal View History

2022-03-14 16:05:16 +08:00
package open_im_media
const (
MediaAddress = "ws://43.128.5.63:7880"
2022-03-14 16:47:18 +08:00
ApiKey = "APIGPW3gnFTzqHH"
ApiSecret = "23ztfSqsfQ8hKkHzHTl3Z4bvaxro0snjk5jwbp5p6Q3"
2022-03-14 16:05:16 +08:00
)
2022-03-14 17:56:20 +08:00
//var roomClient *lksdk.RoomServiceClient
2022-03-14 16:05:16 +08:00
type Media struct {
MediaAddress string
ApiKey string
ApiSecret string
}
func NewMedia() *Media {
return &Media{MediaAddress: MediaAddress,
ApiKey: ApiKey,
ApiSecret: ApiSecret}
}
func (m *Media) GetUrl() string {
return m.MediaAddress
}
func (m *Media) GetJoinToken(room, identity string) (string, error) {
2022-03-14 17:56:20 +08:00
return identity, nil
//at := auth.NewAccessToken(m.ApiKey, m.ApiSecret)
//grant := &auth.VideoGrant{
// RoomJoin: true,
// Room: room,
//}
//at.AddGrant(grant).
// SetIdentity(identity).
// SetValidFor(time.Hour)
//
//return at.ToJWT()
2022-03-14 16:05:16 +08:00
}
func init() {
2022-03-14 17:56:20 +08:00
//roomClient = lksdk.NewRoomServiceClient(MediaAddress, ApiKey, ApiSecret)
2022-03-14 16:05:16 +08:00
}
2022-03-14 18:01:50 +08:00
func (m *Media) CreateRoom(roomName string) (error, error) {
2022-03-14 17:56:20 +08:00
return nil, nil
//return roomClient.CreateRoom(context.Background(), &livekit.CreateRoomRequest{
// Name: roomName,
// EmptyTimeout: 60 * 3,
//})
2022-03-14 16:05:16 +08:00
}