diff --git a/electron.html b/electron.html
index b021e7a..1ed5d3c 100644
--- a/electron.html
+++ b/electron.html
@@ -1,11 +1,13 @@
-
-
-
+
+
-
✨ Great News! OBS v26.1.2
now supports OBS.Ninja without needing the Electron Capture app! 🥳
-
-
-
+
✨ Great News! OBS v26.1.2
now supports OBS.Ninja without needing the Electron Capture app! 🥳
+
✨ Great News!
Electron Capture is now available!
Update yours today to stay up-to-date with security patches.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -166,6 +241,54 @@ input[type='checkbox']:checked {
if (navigator.userAgent.indexOf('Mac OS X') != -1){
document.getElementById("warning4mac").style.display="block";
+} else if (location.hostname.toLowerCase() == "obs.ninja"){
+ try {
+ if (navigator.userAgent.toLowerCase().indexOf(' electron/') > -1) { // for now, just PC or Linux versions only.
+ function compareVersions(version){
+ version = version.split(".");
+ fetch('https://api.github.com/repos/steveseguin/electroncapture/releases/latest')
+ .then(response => response.json())
+ .then(data => {
+ console.log("recentVersion: "+data.tag_name);
+ var recentVersion = data.tag_name.split(".");
+ var ood = false;
+ if (recentVersion[0]>version[0]){
+ ood = true;
+ } else if (recentVersion[0]==version[0]) {
+ if (recentVersion[1]>version[1]){
+ ood = true;
+ } else if (recentVersion[1]==version[1]) {
+ if (recentVersion[2]>version[2]){
+ ood = true;
+ }
+ }
+ }
+ if (ood){
+ document.getElementById("electronVersion").style.display = "block";
+ document.getElementById("currentElectronVersion").innerText = data.tag_name;
+ }
+ });
+ }
+ if (urlParams.has('version')){
+ var ver = urlParams.get('version');
+ console.log("version: "+ver);
+ compareVersions(ver);
+ } else{
+ var checkVersion = setTimeout(function(){ // pre 1.5.2
+ compareVersions("0.0.0");
+ },500);
+
+ const ipcRenderer = require('electron').ipcRenderer;
+ console.log("ELECTRON DETECTED");
+ ipcRenderer.on('appVersion', function(event, version) {
+ clearTimeout(checkVersion);
+ console.log("version: "+version);
+ compareVersions(version);
+ })
+ ipcRenderer.send('getAppVersion');
+ }
+ }
+ } catch(e){console.error(e);}
}
var audioOutputSelect = document.querySelector('select#audioOutput');
@@ -249,9 +372,9 @@ if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(naviga
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;
@@ -307,52 +430,6 @@ if (urlParams.has('name')){
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;