add implicit control to API.

This commit is contained in:
Miroslav Šedivý
2021-12-11 15:18:28 +01:00
parent 87fb85df61
commit 3fd4541da2
3 changed files with 33 additions and 4 deletions
+6
View File
@@ -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
+12
View File
@@ -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;
}
/**
*
+11
View File
@@ -65,7 +65,9 @@ type RoomSettings struct {
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 {