Update OBS Studio to v26.1.2 or newer; older versions and StreamLabs OBS are not supported on macOS.\
download here: https://github.com/obsproject/obs-studio/releases\
\
Please use the Electron Capture app if there are further problems or if you wish to use StreamLabs on macOS still.
\
You can bypass this error message by refreshing,
Clicking Here, or by adding
&streamlabs to the URL, but it may still not actually work.\
\
Please report this problem to steve@seguin.email if you feel it is an error.\
";
}
}
}
//if (navigator.userAgent.indexOf('Mac OS X') != -1) {
// session.codec = "h264"; // default the codec to h264 if OBS is on macOS (that's all it supports with hardware) // oct 2021, OBS now supports vp8 and actually breaks with h264 android devices.
//}
if (session.disableOBS===false){
if (typeof document.visibilityState !== "undefined"){
session.obsState.visibility = document.visibilityState==="visible";
}
getOBSDetails();
window.addEventListener("obsSourceVisibleChanged", obsSourceVisibleChanged);
window.addEventListener("obsSourceActiveChanged", obsSourceActiveChanged);
window.addEventListener("obsSceneChanged", obsSceneChanged);
window.addEventListener("obsStreamingStarted", obsStreamingStarted);
window.addEventListener("obsStreamingStopped", obsStreamingStopped);
window.addEventListener("obsRecordingStarted", obsRecordingStarted);
window.addEventListener("obsRecordingStopped", obsRecordingStopped);
window.addEventListener("obsVirtualcamStarted", obsVirtualcamStarted);
window.addEventListener("obsVirtualcamStopped", obsVirtualcamStopped);
}
} catch (e) {
errorlog(e);
}
}
if (urlParams.has('chroma')) {
log("Chroma ENABLED");
getById("main").style.backgroundColor = "#" + (urlParams.get('chroma') || "0F0");
} // else if (window.obsstudio || (navigator.userAgent.toLowerCase().indexOf(' electron/') > -1)){
// getById("main").style.backgroundColor = "rgba(0,0,0,0)";
//}
//if (urlParams.has('bgimg')){
//
// getById("main").style.background = "#" + (urlParams.get('chroma') || "0F0");
//}
if (urlParams.has('margin')) {
try {
session.videoMargin = urlParams.get('margin') || 10;
session.videoMargin = parseInt(session.videoMargin);
//document.querySelector(':root').style.setProperty('--video-margin', session.videoMargin+"px");
} catch(e){errorlog("variable css failed");}
}
if (urlParams.has('rounded') || urlParams.has('round')) {
try {
session.borderRadius = urlParams.get('rounded') || urlParams.get('round') || 50;
session.borderRadius = parseInt(session.borderRadius);
document.querySelector(':root').style.setProperty('--video-rounded', session.borderRadius+"px");
} catch(e){errorlog("variable css failed");}
}
if (urlParams.has('border')) {
try {
var videoBorder = urlParams.get('border') || 10;
videoBorder = parseInt(videoBorder);
session.border = videoBorder;
videoBorder+="px";
document.querySelector(':root').style.setProperty('--video-border-color', "#000");
document.querySelector(':root').style.setProperty('--video-border', videoBorder);
} catch(e){errorlog("variable css failed");}
}
if (urlParams.has('bordercolor')) {
try {
session.borderColor = urlParams.get('bordercolor') || "#000";
document.querySelector(':root').style.setProperty('--video-border-color', session.borderColor);
} catch(e){errorlog("variable css failed");}
}
if (urlParams.has('retry')) {
session.forceRetry = parseInt(urlParams.get('retry')) || 30;
}
if (session.forceRetry){
setTimeout(function(){
try {
session.retryWatchInterval();
} catch(e){
warnlog(e);
clearTimeout(this);
}
},30000);
}
try {
if (urlParams.has("darkmode") || urlParams.has("nightmode")){
session.darkmode = urlParams.get("darkmode") || urlParams.get("nightmode") || null;
if ((session.darkmode===null) || (session.darkmode === "")){
session.darkmode=true;
} else if ((darkmode=="false") || (darkmode == "0") || (darkmode == 0) || (darkmode == "off")){
session.darkmode=false;
}
} else if (urlParams.has("lightmode") || urlParams.has("lightmode")){
session.darkmode = false;
} else {
session.darkmode = getComputedStyle(document.querySelector(':root')).getPropertyValue('--color-mode').trim();
if (session.darkmode == "dark"){
session.darkmode = true;
} else {
session.darkmode = false;
}
}
if (session.darkmode){
document.body.classList.add("darktheme");
//document.querySelector(':root').style.setProperty('--background-color',"#02050c" );
} else {
document.body.classList.remove("darktheme");
//document.querySelector(':root').style.setProperty('--background-color',"#141926" ); // already set as default.
}
} catch(e){errorlog(e);}
if (urlParams.has("videodevice") || urlParams.has("vdevice") || urlParams.has('vd') || urlParams.has('device') || urlParams.has('d') || urlParams.has('vdo')) {
session.videoDevice = urlParams.get("videodevice") || urlParams.get("vdevice") || urlParams.get("vd") || urlParams.get("device") || urlParams.get("d") || urlParams.get("vdo");
if (session.videoDevice === null) {
session.videoDevice = "1";
} else if (session.videoDevice) {
session.videoDevice = session.videoDevice.toLowerCase().replace(/[\W]+/g, "_");
}
if (session.videoDevice == "false") {
session.videoDevice = 0;
} else if (session.videoDevice == "0") {
session.videoDevice = 0;
} else if (session.videoDevice == "no") {
session.videoDevice = 0;
} else if (session.videoDevice == "off") {
session.videoDevice = 0;
} else if (session.videoDevice == "snapcam") {
session.videoDevice = "snap_camera";
} else if (session.videoDevice == "canon") {
session.videoDevice = "eos";
} else if (session.videoDevice == "camlink") {
session.videoDevice = "cam_link";
} else if (session.videoDevice == "ndi") {
session.videoDevice = "newtek_ndi_video";
} else if (session.videoDevice == "") {
session.videoDevice = 1;
} else if (session.videoDevice == "1") {
session.videoDevice = 1;
} else if (session.videoDevice == "default") {
session.videoDevice = 1;
} else {
// whatever the user entered I guess, santitized.
session.videoDevice = session.videoDevice.replace(/[\W]+/g, "_").toLowerCase();
}
if (!urlParams.has('vdo')){
getById("videoMenu").style.display = "none";
}
log("session.videoDevice:" + session.videoDevice);
}
// audioDevice
if (urlParams.has('audiodevice') || urlParams.has('adevice') || urlParams.has('ad') || urlParams.has('device') || urlParams.has('d')) {
session.audioDevice = urlParams.get("audiodevice") || urlParams.get("adevice") || urlParams.get("ad") || urlParams.get("device") || urlParams.get("d");
if (session.audioDevice === null) {
session.audioDevice = "1";
} //else if (session.audioDevice) {
// session.audioDevice = session.audioDevice.toLowerCase().replace(/[\W]+/g, "_");
//}
if (session.audioDevice == "false") {
session.audioDevice = 0;
} else if (session.audioDevice == "0") {
session.audioDevice = 0;
} else if (session.audioDevice == "no") {
session.audioDevice = 0;
} else if (session.audioDevice == "off") {
session.audioDevice = 0;
} else if (session.audioDevice == "") {
session.audioDevice = 1;
} else if (session.audioDevice == "1") {
session.audioDevice = 1;
} else if (session.audioDevice == "default") {
session.audioDevice = 1;
} else if (session.audioDevice == "ndi") {
session.audioDevice = ["line_newtek_ndi_audio"];
} else {
// whatever the user entered I guess
session.audioDevice = session.audioDevice.split(",");
for (var i =0;i