Skip to content

Commit

Permalink
sync recent changes from alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
steveseguin committed Mar 26, 2024
1 parent b2224a3 commit ae19ce9
Show file tree
Hide file tree
Showing 9 changed files with 210 additions and 70 deletions.
11 changes: 7 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<meta property="twitter:image" content="./media/vdoNinja_logo_full.png" />
<meta name="msapplication-TileColor" content="#da532c" />
<meta name="theme-color" content="#0f131d" />
<link rel="stylesheet" href="./main.css?ver=378" />
<link rel="stylesheet" href="./main.css?ver=379" />
<script type="text/javascript" crossorigin="anonymous" src="./thirdparty/adapter.js"></script>
<style id="lightbox-animations" type="text/css"></style>

Expand Down Expand Up @@ -92,7 +92,7 @@

<script type="text/javascript" crossorigin="anonymous" src="./thirdparty/CodecsHandler.js?ver=10"></script>
<script type="text/javascript" crossorigin="anonymous" src="./thirdparty/aes.js"></script>
<script type="text/javascript" crossorigin="anonymous" src="./webrtc.js?ver=778"></script>
<script type="text/javascript" crossorigin="anonymous" src="./webrtc.js?ver=779"></script>
<input id="zoomSlider" type="range" style="display: none;" />
<span id="electronDragZone" style="pointer-events: none; z-index:-10; position:absolute;top:0;left:0;width:100%;height:2%;-webkit-app-region: drag;min-height:20px;"></span>
<div id="header">
Expand Down Expand Up @@ -2698,14 +2698,17 @@ <h3>Assign to slot:</h3><br />
// session.record = false; // uncomment to block users from being able to record via vdo.ninja's built in recording function
// session.whipServerURL = "wss://whip.vdo.ninja"; // If you deploy your own whip websocket service

// session.GDRIVE_CLIENT_ID = "877199999934-67tq62xxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com"; // get your own id/key from Google Cloud
// session.GDRIVE_API_KEY = 'AINNNNNNNNNNNNNNN-39s99999999999999999'; // lets you upload to google drive if self hosting.

// session.decrypted = session.decodeInvite("U2FsdGVkX1+d58DFIHoO3EQZSuX86ch4PqW2ouztnJ0="); // get a code from invite.cam

</script>
<script type="text/javascript" crossorigin="anonymous" id="lib-js" src="./lib.js?ver=1131"></script>
<script type="text/javascript" crossorigin="anonymous" id="lib-js" src="./lib.js?ver=1136"></script>
<!--
// If you wish to change branding, blank offers a good clean start.
<script type="text/javascript" id="main-js" src="./main.js" data-translation="blank"></script>
-->
<script type="text/javascript" crossorigin="anonymous" id="main-js" src="./main.js?ver=837"></script>
<script type="text/javascript" crossorigin="anonymous" id="main-js" src="./main.js?ver=842"></script>
</body>
</html>
210 changes: 154 additions & 56 deletions lib.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions main.css
Original file line number Diff line number Diff line change
Expand Up @@ -3693,6 +3693,7 @@ div#roomnotes2 {
.controlsGrid button[data-action-type="remote-global-record"] i,
.controlsGrid button[data-action-type="local-global-record"] i,
.controlsGrid button[data-action-type="recorder-local"] i,
.controlsGrid button[data-action-type="recorder-google-drive-remote"] i,
.controlsGrid button[data-action-type="recorder-remote"] i {
color: #e30000;
}
Expand Down
28 changes: 20 additions & 8 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1388,6 +1388,13 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
document.documentElement.style.setProperty('--myvideo-max-width', '100vw');
document.documentElement.style.setProperty('--myvideo-width', '100vw');
document.documentElement.style.setProperty('--myvideo-height', '100vh');

} else if (urlParams.has('fit')) { // not fully implemented yet.
session.cover = true;
document.documentElement.style.setProperty('--fit-style', 'fit');
document.documentElement.style.setProperty('--myvideo-max-width', '100vw');
document.documentElement.style.setProperty('--myvideo-width', '100vw');
document.documentElement.style.setProperty('--myvideo-height', '100vh');
}

if (urlParams.has('record')) {
Expand Down Expand Up @@ -1474,6 +1481,9 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
if (urlParams.has('recordcodec') || urlParams.has('rc')) {
session.recordingVideoCodec = urlParams.get('recordcodec') || urlParams.get('rc') || false;
}
if (urlParams.has('recordfolder')){
session.GDRIVE_FOLDERNAME = urlParams.get('recordfolder') || "";
}

if (urlParams.has('bigbutton')) {
session.bigmutebutton = true;
Expand Down Expand Up @@ -1612,6 +1622,8 @@ async function main(){ // main asyncronous thread; mostly initializes the user s

if (urlParams.has('hiddenscenebitrate')) {
session.hiddenSceneViewBitrate = parseInt(urlParams.get('hiddenscenebitrate')) || 0;
} else if (urlParams.has('layout') && (session.scene!==false)){
session.hiddenSceneViewBitrate = false;
}

if (urlParams.has('preloadbitrate')) {
Expand Down Expand Up @@ -1842,12 +1854,13 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
session.defaultPassword = false;
}

generateHash(session.password + session.salt, 6).then(function(hash) { // million to one error.
generateHash(session.password + session.salt, 6).then(function(hash) { // million to one error. I won't
log("hash is " + hash);
if (hash.substring(0, 4) !== hash_input) { // hash crc checks are just first 4 characters.
generateHash(session.password + "obs.ninja", 6).then(function(hash2) { // million to one error.
if (hash.substring(0, hash_input.length) !== hash_input) { // this hash crc check is usually just the first 4 characters, but i'll match based on whatever is provided;
// max 6 length for security. 2 could be a good option for better security but more than 6 is too big of a security concern.
generateHash(session.password + "obs.ninja", 6).then(function(hash2) { // million to one error; this is to support a legacy salt used. Depreciated, and will be removed eventually
log("hash2 is " + hash2);
if (hash2.substring(0, 4) !== hash_input) { // hash crc checks are just first 4 characters.
if (hash2.substring(0, 4) !== hash_input) { // this legacy hash crc checks is always 4 characters
session.taintedSession = true;
if (!(session.cleanOutput)) {
miniTranslate(getById("request_info_prompt"),"password-incorrect");
Expand All @@ -1856,7 +1869,6 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
getById("mainmenu").style.display = "none";
getById("head1").style.display = "none";
session.cleanOutput = true;

} else {
getById("request_info_prompt").innerHTML = "";
getById("request_info_prompt").style.display = "block";
Expand Down Expand Up @@ -3084,8 +3096,8 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
session.alpha = true;
}

if (urlParams.has('chunked')) {
session.chunked = parseInt(urlParams.get('chunked')) || 2500; // sender side; enables to allows.
if (urlParams.has('chunked') || urlParams.has('chunk')) {
session.chunked = parseInt(urlParams.get('chunked')) || parseInt(urlParams.get('chunk')) || 2500; // sender side; enables to allows.
// session.alpha = true;
if (Firefox || SafariVersion){
if (!session.cleanOutput){
Expand Down Expand Up @@ -7098,7 +7110,7 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
document.addEventListener("mousedown", event => {
MousePressed = true;
});

document.addEventListener("keyup", event => {

if (PPTKeyPressed){
Expand Down
9 changes: 9 additions & 0 deletions meet.html
Original file line number Diff line number Diff line change
Expand Up @@ -1710,6 +1710,15 @@
var iframesrc = "./index.html?novice&ltb=350&minipreview&transparent&hideheader&margin&rounded&hidetranslate&cleandirector&chatbutton=0&vd=0&webcam&nvb&sstype=3&ssb&showlabel=skype&style=2&room="+roomname+additional+additional2+"&b64css="+injectCSS+streamID+label;
}

var params = window.location.search || "";

if (params.startsWith("?")){
params = params.slice(1);
iframesrc = iframesrc + "&" + params
} else {
iframesrc = iframesrc + params
}

if (roomname!==false){
setStorage("savedRoom_comms", {roomname:roomname,password:password}, 9999);
}
Expand Down
1 change: 1 addition & 0 deletions mixer.html
Original file line number Diff line number Diff line change
Expand Up @@ -2461,6 +2461,7 @@ <h3>Customize invite link</h3>
title.innerText = roomname;
title.style.width = "120px";
title.style.display = "block";
title.style.userSelect = "all";
title.style.color = "#d8d8d8";
title.style.margin = "0 auto";
document.getElementById("sources").appendChild(title);
Expand Down
15 changes: 15 additions & 0 deletions obfuscate.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/aes.js"></script>
</head>
<body id="body">
<script>


var parameter = prompt("Enter your VDO.Ninja URL parameters/values to obfuscate, eg: ?password=MYPASSWORD", "?password=MYPASSWORD");
var result = "?i="+encodeURIComponent(CryptoJS.AES.encrypt(parameter, "OBSNINJAFORLIFE").toString());
document.getElementById("body").innerHTML = "Add the following to you VDO.Ninja URL as the parameter string<br><br>"+result

</script>
</body>
</html>
3 changes: 2 additions & 1 deletion presets.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"green":"?chroma",
"1": "webcam&welcome=Welcome to VDO.Ninja",
"4k": "webcam&quality=4k&outboundbitrate=12000"
"4k": "webcam&quality=4k&outboundbitrate=12000",
"versus": "remote&label&quality&maxbandwidth&view&proaudio"
}
2 changes: 1 addition & 1 deletion webrtc.js

Large diffs are not rendered by default.

0 comments on commit ae19ce9

Please sign in to comment.