diff --git a/OpenApi.yml b/OpenApi.yml index db97b49..a65fd87 100644 --- a/OpenApi.yml +++ b/OpenApi.yml @@ -319,6 +319,9 @@ components: control_protection: type: boolean example: true + implicit_control: + type: boolean + example: true broadcast_pipeline: type: string screen: @@ -401,6 +404,9 @@ components: control_protection: type: boolean example: true + implicit_control: + type: boolean + example: true RoomMember: type: object diff --git a/client/src/api/api.ts b/client/src/api/api.ts index 373e1bf..204da27 100644 --- a/client/src/api/api.ts +++ b/client/src/api/api.ts @@ -295,6 +295,12 @@ export interface RoomSettings { * @memberof RoomSettings */ 'control_protection'?: boolean; + /** + * + * @type {boolean} + * @memberof RoomSettings + */ + 'implicit_control'?: boolean; /** * * @type {string} @@ -434,6 +440,12 @@ export interface RoomStats { * @memberof RoomStats */ 'control_protection'?: boolean; + /** + * + * @type {boolean} + * @memberof RoomStats + */ + 'implicit_control'?: boolean; } /** * diff --git a/internal/types/room.go b/internal/types/room.go index 923e014..b582053 100644 --- a/internal/types/room.go +++ b/internal/types/room.go @@ -62,10 +62,12 @@ type RoomResources struct { } type RoomSettings struct { - Name string `json:"name"` - NekoImage string `json:"neko_image"` - MaxConnections uint16 `json:"max_connections"` - ControlProtection bool `json:"control_protection"` + Name string `json:"name"` + NekoImage string `json:"neko_image"` + MaxConnections uint16 `json:"max_connections"` + + ControlProtection bool `json:"control_protection"` + ImplicitControl bool `json:"implicit_control"` UserPass string `json:"user_pass"` AdminPass string `json:"admin_pass"` @@ -101,6 +103,10 @@ func (settings *RoomSettings) ToEnv() []string { env = append(env, "NEKO_CONTROL_PROTECTION=true") } + if settings.ImplicitControl { + env = append(env, "NEKO_IMPLICIT_CONTROL=true") + } + if settings.VideoCodec == "VP8" || settings.VideoCodec == "VP9" || settings.VideoCodec == "H264" { env = append(env, fmt.Sprintf("NEKO_%s=true", strings.ToUpper(settings.VideoCodec))) } @@ -155,6 +161,10 @@ func (settings *RoomSettings) FromEnv(envs []string) error { if ok, _ := strconv.ParseBool(val); ok { settings.ControlProtection = true } + case "NEKO_IMPLICIT_CONTROL": + if ok, _ := strconv.ParseBool(val); ok { + settings.ImplicitControl = true + } case "NEKO_SCREEN": settings.Screen = val case "NEKO_MAX_FPS": @@ -224,6 +234,7 @@ type RoomStats struct { LastUserLeftAt *time.Time `json:"last_user_left_at"` ControlProtection bool `json:"control_protection"` + ImplicitControl bool `json:"implicit_control"` } type RoomMember struct {