canopy/src/views/partial/channelSettings/settings.ejs

54 lines
No EOL
3 KiB
Text

<%# Canopy - The next generation of stoner streaming software
Copyright (C) 2024-2026 Rainbownapkin and the TTN Community
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. %>
<div class="admin-list-div">
<h3>Channel Preferences:</h3>
<div class="dynamic-container">
<form action="javascript:" class="admin-list-field">
<% for(key of Object.keys(channel.settings)){
//Ignore keys w/ custom HTML
if(key == "streamURL" || key == "streamType"){
break;
}%>
<span class="admin-list-field-container">
<label class="admin-list-label"><%= key %>:</label>
<% switch(typeof channel.settings[key]){
case "string": %>
<input data-key="<%= key %>" class="channel-preference-list-item" value="<%= channel.settings[key] %>">
<% break;
default: %>
<input data-key="<%= key %>" class="channel-preference-list-item" type="checkbox" <% if(channel.settings[key]){ %> checked <% } %>>
<% break;
} %>
</span>
<% }; %>
<span class="admin-list-field-container">
<p>Livestream Type: (<a target="_blank" href="/streamInfo">More Info</a>)</p>
<span id="channel-preference-list-stream-settings-grid">
<span>
<input type="radio" name="streamType" id="channel-preference-list-stream-type-webrtc" value="webrtc" <% if(channel.settings["streamType"] == "webrtc"){ %> checked <% }%> >
<label for="channel-preference-list-stream-type-webrtc">Peer-to-Peer (WebRTC/STUN)</label>
</span>
<span>
<input type="radio" name="streamType" id="channel-preference-list-stream-type-hls" value="livehls" <% if(channel.settings["streamType"] == "livehls"){ %> checked <% }%> >
<label for="channel-preference-list-stream-type-hls">Self-Hosted (HLS)</label>
</span>
<input <% if(channel.settings["streamType"] != "livehls"){ %> disabled <%}%> id="channel-preference-list-stream-url" placeholder="HLS Stream URL" value="<%= channel.settings["streamURL"] %>">
</span>
</span>
</form>
</div>
</div>