From 8624f5bd67394ba530dd89b7e7d0a6e379d63152 Mon Sep 17 00:00:00 2001 From: Steve Seguin Date: Thu, 13 May 2021 04:07:17 -0400 Subject: [PATCH] Add files via upload --- electron.html | 371 ++++++++++++++++++++++++++--------------------- iframe.html | 10 ++ index.html | 104 ++++++++++---- main.css | 48 ++++++- main.js | 390 ++++++++++++++++++++++++++++++++++++++++++++------ webrtc.js | 2 +- 6 files changed, 689 insertions(+), 236 deletions(-) diff --git a/electron.html b/electron.html index 0641e56..a4d5b64 100644 --- a/electron.html +++ b/electron.html @@ -1,28 +1,13 @@ - - -
+ +
- + + - - - - - - - - - - - - - - - - - -

-
- - -

- - -
+
+
+ + + +
+
+ +
+
+ + +
+ +
@@ -182,26 +262,33 @@ input[type='checkbox']:checked { * tree. Alternative licencing options can be made available on request. * */ +var lastUrls = JSON.parse(localStorage.getItem('lastUrls')); +if (lastUrls != undefined) { + document.querySelector("#changeText").value = lastUrls[0]; + if (lastUrls.length>0){ + lastUrls.forEach((url)=>{ + var o = document.createElement('option'); + o.value = url; + o.text = url; + document.querySelector("#lastUrls").appendChild(o); + }) + } else { + document.querySelector("#history").style.display="none"; + } +} else { + document.querySelector("#history").style.display="none"; +} +function setUrl(){ + document.querySelector("#changeText").value = document.querySelector("#lastUrls").value; + gohere(); +} -(function (w) { - w.URLSearchParams = w.URLSearchParams || function (searchString) { - var self = this; - self.searchString = searchString; - self.get = function (name) { - var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(self.searchString); - if (results == null) { - return null; - } - else { - return decodeURI(results[1]) || 0; - } - }; - } - -})(window) - -var urlParams = new URLSearchParams(window.location.search); +function resetHistory(){ + localStorage.clear(); + document.querySelector('#lastUrls').innerHTML = ''; + lastUrls = []; +} if (navigator.userAgent.indexOf('Mac OS X') != -1){ document.getElementById("warning4mac").style.display="block"; @@ -231,7 +318,7 @@ if (navigator.userAgent.indexOf('Mac OS X') != -1){ document.getElementById("electronVersion").style.display = "block"; document.getElementById("currentElectronVersion").innerText = data.tag_name; } - }); + }).catch(console.error); } if (urlParams.has('version')){ var ver = urlParams.get('version'); @@ -313,15 +400,32 @@ function enterPressed(event, callback){ } } +(function (w) { + w.URLSearchParams = w.URLSearchParams || function (searchString) { + var self = this; + self.searchString = searchString; + self.get = function (name) { + var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(self.searchString); + if (results == null) { + return null; + } + else { + return decodeURI(results[1]) || 0; + } + }; + } +})(window) + +var urlParams = new URLSearchParams(window.location.search); var isMobile = false; if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){ // does not detect iPad Pros. isMobile=true; // if iOS, default to H264? meh. let's not. } // Windows can show the cursor, since it captures in a different way. -if (navigator.platform.indexOf("Win") != -1){ - document.getElementById("showcursor").checked=true; -} +//if (navigator.platform.indexOf("Win") != -1){ +// document.getElementById("showcursor").checked=true; +//} function updateURLParameter(url, param, paramVal){ var TheAnchor = null; @@ -374,60 +478,28 @@ if (urlParams.has('name')){ } } +function addUrlToHistory(url){ + if (lastUrls == undefined){ + lastUrls = []; + } + if ( lastUrls[0] != url ) { + lastUrls.unshift(url); + if (lastUrls.length == 6) { + lastUrls.pop(); + } + } +} + function modURL(ele=false){ var url = document.getElementById('changeText').value; console.log(url); - if ((url.split("view").length>0) || (url.split("room").length>0)){ - if (!document.getElementById("showcursor").checked){ - url=updateURLParameter(url, "nocursor", ""); - } else { - url=updateURLParameter(url, "nocursor", false); - } - - if (ele!=false){ - if (ele.id =="prefervp9"){ - if (document.getElementById("prefervp9").checked){ - url=updateURLParameter(url, "codec", "vp9"); - } else { - url=updateURLParameter(url, "codec", false); - } - } - - if (ele.id =="highbitrate"){ - if (document.getElementById("highbitrate").checked){ - url=updateURLParameter(url, "bitrate", "10000"); - } else { - url=updateURLParameter(url, "bitrate", false); - } - } - - if (ele.id =="stereo"){ - if (document.getElementById("stereo").checked){ - url=updateURLParameter(url, "proaudio", ""); - document.getElementById("messageDiv").innerHTML = "Audio bitrate increased to 256-kbps.\n\nPlease note that the Sender must also have the &proaudio flag added for full-effect"; - document.getElementById("messageDiv").style.display="block"; - setTimeout(function(){document.getElementById("messageDiv").style.opacity="1.0";},0); - } else { - url=updateURLParameter(url, "proaudio", false); - setTimeout(function(){document.getElementById("messageDiv").style.opacity="0";},0); - } - } - - if (ele.id =="buffer"){ - if (document.getElementById("buffer").checked){ - url=updateURLParameter(url, "buffer", ""); - } else { - url=updateURLParameter(url, "buffer", false); - } - } - } - - } document.getElementById('changeText').value = url; console.log(url); return url; } function gohere(){ + addUrlToHistory(document.getElementById('changeText').value); + localStorage.setItem('lastUrls', JSON.stringify(lastUrls)); var url = modURL(true); if (!(document.getElementById('changeText').value.includes("obs.ninja")) && (document.getElementById('changeText').value.includes("http")) && (document.getElementById('changeText').value.includes("&sink"))){ alert("Notice: The &sink command is domain specific.\nVisit https://YOURDOMAIN.com/electron instead."); @@ -437,27 +509,4 @@ function gohere(){ getPermssions(); - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/iframe.html b/iframe.html index aa47e2f..3ac4520 100644 --- a/iframe.html +++ b/iframe.html @@ -238,6 +238,16 @@ function loadIframe(){ // this is pretty important if you want to avoid camera button.onclick = function(){iframe.contentWindow.postMessage({"function":"previewWebcam"}, '*');}; // publishScreen iframeContainer.appendChild(button); + var button = document.createElement("button"); + button.innerHTML = "Change to Camera #2"; + button.onclick = function(){iframe.contentWindow.postMessage({"changeVideoDevice":2}, '*');}; // change text of add camera button + iframeContainer.appendChild(button); + + var button = document.createElement("button"); + button.innerHTML = "Change to Microphone #4"; + button.onclick = function(){iframe.contentWindow.postMessage({"changeAudioDevice":4}, '*');}; // change text of add camera button + iframeContainer.appendChild(button); + var button = document.createElement("button"); button.innerHTML = "eval('alert(\"DANGERUS\")'"; button.onclick = function(){iframe.contentWindow.postMessage({"function":"eval", "value":'alert(\"DANGERUS\")'}, '*');}; // publishScreen diff --git a/index.html b/index.html index 4016883..fa38dce 100644 --- a/index.html +++ b/index.html @@ -55,7 +55,7 @@ } - + @@ -717,12 +717,12 @@
- ⛔ Site Updated on May 5th: 📵 🚷 ⚠ THIS ALPHA BUILD IS NOT TESTED AND NOT COMPATIBLE WITH PRODUCTION ☣ ☢ 🔞 + 👓🔆 Site Updated on May 13th: v17 Release Notes. The previous version can be found at https://obs.ninja/v164/ if you are having issues with this minor update.

- 🛠 For support, see the sub-reddit or join the Discord . The Docs are here and my personal email is steve@seguin.email + 🛠 For support, see the sub-reddit or join the Discord . The documentation is here and my personal email is steve@seguin.email

@@ -825,7 +825,7 @@