From e3507b00f864fa193109c65b7b6c8bb5676d598b Mon Sep 17 00:00:00 2001 From: rainbow napkin Date: Mon, 6 Jul 2026 21:28:55 -0400 Subject: [PATCH] Added channel preference UI for WebRTC Streaming --- src/schemas/channel/channelSchema.js | 11 +++++++++ .../partial/channelSettings/settings.ejs | 23 +++++++++++++++++-- www/css/adminPanel.css | 10 ++++++++ 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/src/schemas/channel/channelSchema.js b/src/schemas/channel/channelSchema.js index b6df0b1..8bfa484 100644 --- a/src/schemas/channel/channelSchema.js +++ b/src/schemas/channel/channelSchema.js @@ -35,6 +35,11 @@ const chatSchema = require('./chatSchema'); //Utils const { exceptionHandler, errorHandler } = require('../../utils/loggerUtils'); +/** + * "Enum" for emote type property + */ +const streamMethodEnum = ["webrtc","hls"]; + /** * DB Schema for Documents containing de-hydrated representations of Canopy Stream/Chat Channels */ @@ -71,6 +76,12 @@ const channelSchema = new mongoose.Schema({ streamURL: { type: mongoose.SchemaTypes.String, default: '' + }, + streamType: { + type: mongoose.SchemaTypes.String, + enum: streamMethodEnum, + default: streamMethodEnum[0] + } }, permissions: { diff --git a/src/views/partial/channelSettings/settings.ejs b/src/views/partial/channelSettings/settings.ejs index ec740eb..b077763 100644 --- a/src/views/partial/channelSettings/settings.ejs +++ b/src/views/partial/channelSettings/settings.ejs @@ -17,7 +17,11 @@ along with this program. If not, see . %>

Channel Preferences:

- <% Object.keys(channel.settings).forEach((key) => { %> + <% for(key of Object.keys(channel.settings)){ + //Ignore keys w/ custom HTML + if(key == "streamURL" || key == "streamType"){ + break; + }%> <% switch(typeof channel.settings[key]){ @@ -29,7 +33,22 @@ along with this program. If not, see . %> <% break; } %> - <% }); %> + <% }; %> + +

Livestream Type:

+ + + + + + + + + + "> + + +
\ No newline at end of file diff --git a/www/css/adminPanel.css b/www/css/adminPanel.css index dbcf120..1141bf5 100644 --- a/www/css/adminPanel.css +++ b/www/css/adminPanel.css @@ -139,6 +139,16 @@ img.admin-list-entry-item{ width: 8em; } +#channel-preference-list-stream-settings-grid{ + display: grid; + grid-template-columns: auto auto; + row-gap: 0.5em; +} + +#channel-preference-list-stream-url { + grid-column: 2; +} + div.toke-command-list{ display: grid; grid-template-columns: repeat(auto-fit, minmax(15em, 1fr));