Add option to hide viewer count. Closes #1939

This commit is contained in:
Gabe Kangas
2022-06-26 00:46:55 -07:00
parent 97db93e0d7
commit b08393295f
11 changed files with 209 additions and 125 deletions

View File

@@ -29,6 +29,7 @@ export const API_VIDEO_SEGMENTS = '/video/streamlatencylevel';
export const API_VIDEO_VARIANTS = '/video/streamoutputvariants';
export const API_WEB_PORT = '/webserverport';
export const API_YP_SWITCH = '/directoryenabled';
export const API_HIDE_VIEWER_COUNT = '/hideviewercount';
export const API_CHAT_DISABLE = '/chat/disable';
export const API_CHAT_JOIN_MESSAGES_ENABLED = '/chat/joinmessagesenabled';
export const API_CHAT_ESTABLISHED_MODE = '/chat/establishedusermode';
@@ -188,6 +189,13 @@ export const FIELD_PROPS_YP = {
tip: 'Turn this ON to request to show up in the directory.',
};
export const FIELD_PROPS_HIDE_VIEWER_COUNT = {
apiPath: API_HIDE_VIEWER_COUNT,
configPath: '',
label: 'Hide viewer count',
tip: 'Turn this ON to hide the viewer count the web page.',
};
export const DEFAULT_VARIANT_STATE: VideoVariant = {
framerate: 24,
videoPassthrough: false,

View File

@@ -75,6 +75,7 @@ export const initialServerConfigState: ConfigDetails = {
chatDisabled: false,
chatJoinMessagesEnabled: true,
chatEstablishedUserMode: false,
hideViewerCount: false,
};
const initialServerStatusState = {
@@ -156,6 +157,7 @@ const ServerStatusProvider = ({ children }) => {
};
}, []);
// eslint-disable-next-line react/jsx-no-constructed-context-values
const providerValue = {
...status,
serverConfig: config,