Commit 1b72a2ea authored by Simon Kirsten's avatar Simon Kirsten
Browse files

Fixed chat and formatting

parent a388d7c5
Pipeline #43032 failed with stages
in 2 minutes and 54 seconds
......@@ -9,7 +9,7 @@ function newLargePlayer(channel) {
width: "",
height: "",
controls: false,
muted: false
muted: false,
});
}
......@@ -19,7 +19,7 @@ function newSmallPlayer(channel) {
width: "",
height: "",
controls: false,
muted: true
muted: true,
});
}
......@@ -33,7 +33,7 @@ const defaultState = {
small_channel: "",
volume: 0.5,
small_scale: 0.3,
show_chat: false
show_chat: false,
};
let state = defaultState;
......@@ -76,7 +76,10 @@ function updateState(newState) {
}
let chat_elem_src =
"https://www.twitch.tv/embed/" + state.large_channel + "/chat?darkpopout";
"https://www.twitch.tv/embed/" +
state.large_channel +
"/chat?darkpopout&parent=" +
location.hostname;
if (chat_elem_src != chat_elem.src) {
chat_elem.src = chat_elem_src;
......@@ -129,7 +132,7 @@ if (!window.EventSource) {
} else {
const events = new EventSource("/display");
events.onmessage = m => {
events.onmessage = (m) => {
updateState(JSON.parse(m.data));
};
......@@ -137,7 +140,7 @@ if (!window.EventSource) {
overlay_elem.firstElementChild.innerText = "Nothing playing";
};
events.onerror = err => {
events.onerror = (err) => {
console.error(err);
updateState(defaultState);
......@@ -157,7 +160,7 @@ function toggleFullscreen() {
}
}
large_player_elem.addEventListener("mousedown", event => {
large_player_elem.addEventListener("mousedown", (event) => {
if (event.detail > 1) {
// double click
toggleFullscreen();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment