From f75213cb9ab9d01124e0a68f51f3d316c498fcc0 Mon Sep 17 00:00:00 2001 From: steveseguin Date: Fri, 24 Feb 2023 19:00:01 -0500 Subject: [PATCH] minor sync --- comms.html | 54 ++++++++++-- index.html | 16 ++-- lib.js | 254 ++++++++++++++++++++++++++++++++++++----------------- main.css | 48 ++++++++-- main.js | 91 +++++++++++++++---- mixer.html | 2 +- 6 files changed, 351 insertions(+), 114 deletions(-) diff --git a/comms.html b/comms.html index 7fa8d8d..45745e4 100644 --- a/comms.html +++ b/comms.html @@ -1109,6 +1109,8 @@ password = urlParams.get('password') || urlParams.get('pass') || urlParams.get('pw') || urlParams.get('p'); } + + var aspectRatio = 16/9.0; document.documentElement.style.setProperty('--aspect-ratio', aspectRatio); @@ -1791,13 +1793,15 @@ additional2 += "&chatbutton=0"; } + urlEdited = urlEdited.replace("?",""); + var chatmsg = "Welcome to the Comms app. Select a group to participate in."; chatmsg = encodeURIComponent(chatmsg); if (window.location.hostname == "comms.cam"){ - var iframesrc = "https://vdo.ninja/?controlbarspace&volumecontrol&sharperscreen&groupmode&novice<b=350&minipreview&transparent&hideheader&margin&rounded&hidetranslate&cleandirector&vd=0&webcam&nvb&sstype=3&ssb&showlabel=toprounded&labelsize=85&style=2&room="+roomname+additional+additional2+"&b64css="+injectCSS+streamID+label+"&chatmsg="+chatmsg; + var iframesrc = "https://vdo.ninja/?"+urlEdited+"&controlbarspace&volumecontrol&sharperscreen&groupmode&novice<b=350&minipreview&transparent&hideheader&margin&rounded&hidetranslate&cleandirector&vd=0&webcam&nvb&sstype=3&ssb&showlabel=toprounded&labelsize=85&style=2&room="+roomname+additional+additional2+"&b64css="+injectCSS+streamID+label+"&chatmsg="+chatmsg; } else { - var iframesrc = "./index.html?controlbarspace&volumecontrol&sharperscreen&groupmode&novice<b=350&minipreview&transparent&hideheader&margin&rounded&hidetranslate&cleandirector&vd=0&webcam&nvb&sstype=3&ssb&showlabel=toprounded&labelsize=85&style=2&room="+roomname+additional+additional2+"&b64css="+injectCSS+streamID+label+"&chatmsg="+chatmsg; + var iframesrc = "./index.html?"+urlEdited+"&controlbarspace&volumecontrol&sharperscreen&groupmode&novice<b=350&minipreview&transparent&hideheader&margin&rounded&hidetranslate&cleandirector&vd=0&webcam&nvb&sstype=3&ssb&showlabel=toprounded&labelsize=85&style=2&room="+roomname+additional+additional2+"&b64css="+injectCSS+streamID+label+"&chatmsg="+chatmsg; } @@ -2062,7 +2066,37 @@ var group = document.createElement('span'); group.dataset.group = groupID; group.classList.add("group"); - group.innerText = "group: "+groupID; + //group.innerText = "group: "+groupID; + var name = document.createElement('span'); + + + if (savedSession.aliases && savedSession.aliases[groupID]){ + name.innerHTML = savedSession.aliases[groupID]; + name.innerHTML += "
group: "+groupID+""; + } else { + name.innerHTML = "group: "+groupID; + } + name.title = "Hold CTRL and click to give this group a custom label"; + group.appendChild(name); + name.groupID = groupID; + name.onclick = function(e){ + if (e.ctrlKey){ + var nn = prompt("Rename this group", this.groupID); + if (this.groupID == nn){ + name.innerHTML = "group: "+nn; + delete group.dataset.alias; + //delete savedSession.aliases[this.groupID]; + } else if (nn){ + name.innerHTML = nn; + name.innerHTML += "
group: "+groupID+""; + group.dataset.alias = nn; + //savedSession.aliases[this.groupID] = nn; + } + saveSession(); + } else { + this.parentNode.click(); + } + } group.onclick = remoteActivate; group.title = "Activate this group; the view scene link will be updated"; @@ -2184,9 +2218,11 @@ console.log("remoteActivate"); if (event.target && group===null){ group = event.target.dataset.group; - event.target.parentNode.classList.toggle("pressed"); + if (event.target && event.target.parentNode){ + event.target.parentNode.classList.toggle("pressed"); + } } - if (event.target.parentNode.classList.contains("pressed")){ + if (event.target && event.target.parentNode && event.target.parentNode.classList.contains("pressed")){ var index = savedSession.activeGroups.indexOf(group); if (index == -1){ savedSession.activeGroups.push(group); @@ -2214,6 +2250,7 @@ savedSession.activeViewGroups = []; savedSession.settings = {}; savedSession.version = 1; + savedSession.aliases = {}; for (var i=0;i - + @@ -83,7 +83,7 @@ - + -
+
@@ -898,7 +900,7 @@

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

@@ -2405,11 +2407,11 @@ // session.hidehome = true; // If used, 'hide home' will make the landing page inaccessible, along with hiding a few go-home elements. // session.record = false; // uncomment to block users from being able to record via vdo.ninja's built in recording function - + - + diff --git a/lib.js b/lib.js index 1604f51..928156f 100644 --- a/lib.js +++ b/lib.js @@ -500,6 +500,7 @@ function playAllVideos(){ } for (var i in session.rpcs){ + if (session.rpcs[i].whip){continue;} try{ if (session.rpcs[i].videoElement){ log("I: "+i); @@ -684,7 +685,7 @@ async function delay(ms) { } var Prompts = {}; -async function promptAlt(inputText, block=false, asterix=false, value=false){ +async function promptAlt(inputText, block=false, asterix=false, value=false, time=false){ var result = null; if (session.beepToNotify){ playtone(); @@ -710,41 +711,80 @@ async function promptAlt(inputText, block=false, asterix=false, value=false){ type = "password"; } - - modalTemplate = - `