From 867707a46ba62936be72a380ab1a437d45f3a078 Mon Sep 17 00:00:00 2001 From: Trysdyn Black Date: Sat, 10 Sep 2022 15:52:11 -0700 Subject: [PATCH] Genericize the embed parent setting Instead of repeating the domain four times, make it a variable on line 2 and use the variable. --- js/live.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/js/live.js b/js/live.js index d100bc4..afd9561 100644 --- a/js/live.js +++ b/js/live.js @@ -1,3 +1,6 @@ +// Embed source domain. This should be the domain(s) of the site using this tool +source_domains = ['localhost'] + // Dimensions of each embed, used when initializing the embeds embed_height = 315; embed_width = 560; @@ -131,7 +134,7 @@ function setup() { layout: 'video', controls: false, channel: 'jank_science_theater', - parent: ['voidfox.com'] + parent: source_domains })); embeds.push(new Twitch.Embed('embed1', { @@ -142,7 +145,7 @@ function setup() { layout: 'video', controls: false, channel: 'jank_science_theater', - parent: ['voidfox.com'] + parent: source_domains })); embeds.push(new Twitch.Embed('embed2', { @@ -153,7 +156,7 @@ function setup() { layout: 'video', controls: false, channel: 'jank_science_theater', - parent: ['voidfox.com'] + parent: source_domains })); embeds.push(new Twitch.Embed('embed3', { @@ -164,7 +167,7 @@ function setup() { layout: 'video', controls: false, channel: 'jank_science_theater', - parent: ['voidfox.com'] + parent: source_domains })); // Set up volume slider handler