Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

Start of a web UI config

Gabe Kangasa3c3276a489d
diff --git a/webroot/index.html b/webroot/index.html
index 778c79a140..e77ff0c46f 100644
--- a/webroot/index.html
+++ b/webroot/index.html
@@ -120,6 +120,7 @@
</div>
</div>
+ <script src="js/config.js"></script>
<script src="js/utils.js"></script>
<script src="js/message.js"></script>
<script src="js/app.js"></script>
diff --git a/webroot/js/app.js b/webroot/js/app.js
index 10e74fa23a..2a59b9bf17 100644
--- a/webroot/js/app.js
+++ b/webroot/js/app.js
@@ -28,6 +28,8 @@ function setupApp() {
window.VIDEOJS_NO_DYNAMIC_STYLE = true;
var appMessagingMisc = new Messaging();
appMessagingMisc.init();
+
+ const config = new Config();
}
async function getStatus() {
diff --git a/webroot/js/config.js b/webroot/js/config.js
new file mode 100644
index 0000000000..d7ba9f1c5c
--- /dev/null
+++ b/webroot/js/config.js
@@ -0,0 +1,21 @@
+class Config {
+
+ constructor() {
+ this.init();
+ }
+
+ async init() {
+ const configFileLocation = "js/config.json";
+
+ try {
+ const response = await fetch(configFileLocation);
+ const configData = await response.json();
+ Object.assign(this, configData);
+ console.log(this);
+
+ } catch(error) {
+ console.log(error);
+ // No config file present. That's ok. It's not required.
+ }
+ }
+}
\ No newline at end of file
diff --git a/webroot/js/config.json b/webroot/js/config.json
new file mode 100644
index 0000000000..4d396c8e30
--- /dev/null
+++ b/webroot/js/config.json
@@ -0,0 +1,5 @@
+{
+ "title": "Title",
+ "logo": "https://vignette.wikia.nocookie.net/animalcrossing/images/b/b3/NH-character-Blathers.png/revision/latest?cb=20200229053519",
+ "color": "#276749"
+}
\ No newline at end of file