Merge pull request #1015 from goinnovise/bug/page-load-twitch-box

Twitch + Chat Bugfix - Detect twitch URL properly
This commit is contained in:
Steve Seguin 2023-03-16 18:09:01 -04:00 committed by GitHub
commit 2b0db54eb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -137,7 +137,11 @@ function loadIframes(url=false){
} else {
var room1 = "https://"+path+"/?push="+roomname+"&webcam&autostart&vd=front&ad=1&transparent&noheader";
}
var room2 = "https://www.twitch.tv/embed/"+twitch+"/chat?parent="+location.hostname;
var room2 = twitch.startsWith("https://")
? twitch
: `https://www.twitch.tv/embed/${twitch}/chat?parent=${location.hostname}`;
var iframe = document.createElement("iframe");
iframe.allow = "autoplay;camera;microphone;fullscreen;picture-in-picture;";
iframe.src = room1;