网站通话使用webrtc,新增ffmpeg
This commit is contained in:
@@ -33,7 +33,7 @@ type CreateCallRoomRequest struct {
|
||||
type JoinCallRoomRequest struct {
|
||||
RoomID string `json:"room_id" binding:"required"`
|
||||
UserID string `json:"user_id" binding:"required"`
|
||||
Platform string `json:"platform" binding:"required,oneof=h5 app miniprogram"` // h5/app/miniprogram
|
||||
Platform string `json:"platform" binding:"required,oneof=h5 web app miniprogram wxapp"` // h5/web/app/miniprogram/wxapp
|
||||
}
|
||||
|
||||
// LeaveCallRoomRequest 离开通话房间请求
|
||||
@@ -157,8 +157,8 @@ func JoinCallRoomHandler(c *gin.Context) {
|
||||
}
|
||||
|
||||
switch req.Platform {
|
||||
case "h5", "app":
|
||||
// H5/App 使用 WebRTC 或 RTMP 模式
|
||||
case "h5", "web", "app":
|
||||
// H5/Web/App 使用 WebRTC 或 RTMP 模式
|
||||
pType := mediaserver.ParticipantTypeWebRTC
|
||||
participant, err := room.AddParticipant(req.UserID, pType)
|
||||
if err != nil {
|
||||
@@ -206,7 +206,7 @@ func JoinCallRoomHandler(c *gin.Context) {
|
||||
}
|
||||
response.FlvPullURLs = flvPullURLs
|
||||
|
||||
case "miniprogram":
|
||||
case "miniprogram", "wxapp":
|
||||
// 小程序使用 RTMP
|
||||
pType := mediaserver.ParticipantTypeRTMP
|
||||
participant, err := room.AddParticipant(req.UserID, pType)
|
||||
|
||||
Reference in New Issue
Block a user