Skip to content

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

Use client-side config files to config things

Gabe Kangasc6e4ea8349e8
diff --git a/webroot/index.html b/webroot/index.html
index 177ede131f..e57910a975 100644
--- a/webroot/index.html
+++ b/webroot/index.html
@@ -44,7 +44,7 @@ possible hacks
<div id="top-content">
<header class="flex border-b border-gray-900 border-solid shadow-md">
<h1 class="text-gray-400">
- 😈 Owncast
+ 😈 {{title}}
</h1>
<div id="user-options-container" class="flex">
@@ -99,17 +99,9 @@ possible hacks
<div id="user-content" class="user-content">
<!-- USER CONTENT... -->
- <div>
- Blathers is an owl with brown feathers. His face is white and he has a yellow beak. His arms are wing shaped and he has yellow talons. His eyes are very big with small black irises. He also has big pink cheek circles on his cheeks. His belly appears to be checkered in diamonds with light brown and white squares, similar to an argyle vest, which is traditionally associated with academia. His green bowtie further alludes to his academic nature.
- <br />
-
- </div>
- <div>
- Blathers is an owl with brown feathers. His face is white and he has a yellow beak. His arms are wing shaped and he has yellow talons. His eyes are very big with small black irises. He also has big pink cheek circles on his cheeks. His belly appears to be checkered in diamonds with light brown and white squares, similar to an argyle vest, which is traditionally associated with academia. His green bowtie further alludes to his academic nature.
+ <div v-html="description"></div>
- </div>
-
</div>
</div>
@@ -121,16 +113,7 @@ possible hacks
<div id="user-content-touch" class="user-content">
<!-- USER CONTENT... -->
- <div>
- Blathers is an owl with brown feathers. His face is white and he has a yellow beak. His arms are wing shaped and he has yellow talons. His eyes are very big with small black irises. He also has big pink cheek circles on his cheeks. His belly appears to be checkered in diamonds with light brown and white squares, similar to an argyle vest, which is traditionally associated with academia. His green bowtie further alludes to his academic nature.
- <br />
-
- </div>
- <div>
- Blathers is an owl with brown feathers. His face is white and he has a yellow beak. His arms are wing shaped and he has yellow talons. His eyes are very big with small black irises. He also has big pink cheek circles on his cheeks. His belly appears to be checkered in diamonds with light brown and white squares, similar to an argyle vest, which is traditionally associated with academia. His green bowtie further alludes to his academic nature.
-
-
- </div>
+ <div v-html="description"></div>
</div>
diff --git a/webroot/js/app.js b/webroot/js/app.js
index 6751e7c31b..9bfcbeff26 100644
--- a/webroot/js/app.js
+++ b/webroot/js/app.js
@@ -1,4 +1,4 @@
-function setupApp() {
+async function setupApp() {
Vue.filter('plural', function (string, count) {
if (count === 1) {
return string;
@@ -15,6 +15,8 @@ function setupApp() {
sessionMaxViewerCount: 0,
overallMaxViewerCount: 0,
messages: [],
+ description: "",
+ title: "",
},
});
@@ -25,7 +27,9 @@ function setupApp() {
var appMessagingMisc = new Messaging();
appMessagingMisc.init();
- const config = new Config();
+ const config = await new Config().init();
+ app.description = autoLink(config.description, { embed: false });
+ app.title = config.title;
}
async function getStatus() {
diff --git a/webroot/js/config.js b/webroot/js/config.js
index 1611bec3ba..72ea049583 100644
--- a/webroot/js/config.js
+++ b/webroot/js/config.js
@@ -1,9 +1,4 @@
class Config {
-
- constructor() {
- this.init();
- }
-
async init() {
const configFileLocation = "./js/config.json";
@@ -11,6 +6,7 @@ class Config {
const response = await fetch(configFileLocation);
const configData = await response.json();
Object.assign(this, configData);
+ return this;
} catch(error) {
console.log(error);
// No config file present. That's ok. It's not required.
diff --git a/webroot/js/config.json b/webroot/js/config.json
index 4d396c8e30..e42ba63db6 100644
--- a/webroot/js/config.json
+++ b/webroot/js/config.json
@@ -1,5 +1,10 @@
{
- "title": "Title",
- "logo": "https://vignette.wikia.nocookie.net/animalcrossing/images/b/b3/NH-character-Blathers.png/revision/latest?cb=20200229053519",
- "color": "#276749"
+ "title": "Owncast Demo Server",
+ "logo": "/img/logo.png",
+ "description": "This is a demo server for Owncast. You can read more about it at owncast.online. You can edit this description in your web config file. <br><br>Blathers is an owl with brown feathers. His face is white and he has a yellow beak. His arms are wing shaped and he has yellow talons. His eyes are very big with small black irises. He also has big pink cheek circles on his cheeks. His belly appears to be checkered in diamonds with light brown and white squares, similar to an argyle vest, which is traditionally associated with academia. His green bowtie further alludes to his academic nature.",
+ "tags": [
+ "music",
+ "software",
+ "animal crossing"
+ ]
}
\ No newline at end of file