part 1
This commit is contained in:
Steve Seguin 2022-04-27 18:14:34 -04:00 committed by GitHub
parent c79b20ce51
commit 358b383e6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 3500 additions and 1236 deletions

View File

@ -272,6 +272,12 @@
flex-wrap: nowrap;
flex-grow: 1;
}
#version{
margin: 0 auto;
font-size: 30%;
display: inline-block;
color: #000A;
}
</style>
</head>
@ -306,6 +312,7 @@
</div>
</div>
<div id="version"></div>
<script>
@ -368,6 +375,7 @@ if ((location.hostname.toLowerCase() == "vdo.ninja") || (location.hostname.toLow
try {
if (navigator.userAgent.toLowerCase().indexOf(' electron/') > -1) {
function compareVersions(version){
document.getElementById("version").innerHTML = "Current version: "+version;
version = version.split(".");
fetch('https://api.github.com/repos/steveseguin/electroncapture/releases/latest')
.then(response => response.json())
@ -375,7 +383,7 @@ if ((location.hostname.toLowerCase() == "vdo.ninja") || (location.hostname.toLow
console.log("recentVersion: "+data.tag_name);
var recentVersion = data.tag_name.split(".");
var ood = false;
if (recentVersion[0]>version[0]){
if (recentVersion[0]>version[0]){
ood = true;
} else if (recentVersion[0]==version[0]) {
if (recentVersion[1]>version[1]){
@ -392,19 +400,16 @@ if ((location.hostname.toLowerCase() == "vdo.ninja") || (location.hostname.toLow
}
}).catch(console.error);
}
if (urlParams.has('version')){
var ver = urlParams.get('version');
if (urlParams.has('version') || urlParams.has('ver')){
var ver = urlParams.get('version') || urlParams.get('ver');
console.log("version: "+ver);
compareVersions(ver);
} else{
var checkVersion = setTimeout(function(){ // pre 1.5.2
compareVersions("0.0.0");
},500);
document.getElementById("version").innerHTML = "Elevate app privilleges to see current version";
try{
const ipcRenderer = require('electron').ipcRenderer;
console.log("ELECTRON DETECTED");
ipcRenderer.on('appVersion', function(event, version) {
clearTimeout(checkVersion);
console.log("version: "+version);
compareVersions(version);
})

View File

@ -7,6 +7,7 @@
if (msie>0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)){ // If MSIE or IE 11
alert("Internet Explorer is not supported.\n\nPlease consider using Microsoft Edge or Google Chrome instead\n\nYou will be forwarded to the download page for MS Edge now.");
console.error("INTERNET EXPLORER IS EVIL");
document.write("Internet Explorer is not supported");
window.location = "https://www.microsoft.com/edge";
}
} catch(e){
@ -79,7 +80,7 @@
<link itemprop="url" href="./media/vdoNinja_logo_full.png" />
</span>
<script type="text/javascript" crossorigin="anonymous" src="./thirdparty/CodecsHandler.js?ver=37"></script>
<script type="text/javascript" crossorigin="anonymous" src="./webrtc.js?ver=435"></script>
<script type="text/javascript" crossorigin="anonymous" src="./webrtc.js?ver=438"></script>
<input id="zoomSlider" type="range" style="display: none;" />
<div id="header">
@ -113,7 +114,7 @@
<span data-translate="you-are-in-the-control-center">Control center for room:</span>
<div id="dirroomid" style="font-size: 140%; color: #99c; display: inline-block;"></div>
<span id="saveRoom" onclick="saveRoom(this)" style='cursor:pointer;margin-left:10px;' title="Will remember the room, prompting you the next time you visit if you wish to load this director's room again">💾</button>
<span id="saveRoom" onclick="saveRoom(this)" style='cursor:pointer;margin-left:10px;' title="Will remember the room, prompting you the next time you visit if you wish to load this director's room again">💾</span>
</font>
</div>
<div id="head2" class="advanced" style="display: inline-block; text-decoration: none; font-size: 60%; color: white;">
@ -439,6 +440,24 @@
<p><span id="headphoneTipContext1"></span></p>
</div>
</span>
<div id="avatarDiv" class="advanced">
<div style="text-align: left;display: inline-block;">
<i class="las la-robot"></i><span data-translate="select-avatar-image"> Default Avatar / Placeholder Image: </span>
</div>
<div id="selectAvatarImage" style="margin-top:10px;">
<img src="./media/avatar.webp" loading="lazy" id="defaultAvatar1" style="max-width:130px;max-height:73.5px;display:inline-block;margin:10px;cursor:pointer;" onclick="changeAvatarImage(event, this);"/>
<label class="selected" id="noAvatarSelected" style="width:130px;display:inline-block;margin:0 1px; text-align: center; cursor:pointer;">
<i class="las la-minus-circle" style="font-size: 3em;"></i><br />No Image Selected
<button onclick="changeAvatarImage(event, this)" style="position: fixed; top: -100em; margin-left:10px; border:1px solid #555;"></button>
</label>
<label style="width:130px;display:inline-block;margin:0 1px; text-align: center; cursor:pointer;">
<i class="las la-hdd" style="font-size: 3em;"></i><br />Select Local Image
<input type="file" onchange="changeAvatarImage(event, this)" accept="image/*" style="position: fixed; top: -100em; margin-left:10px; border:1px solid #555;">
</label>
</div>
</div>
<div id="effectsDiv">
<div style="text-align: left;display: inline-block;">
<i class="las la-robot"></i><span data-translate="select-digital-effect"> Digital Video Effects: </span>
@ -452,7 +471,7 @@
<option value="anon" data-translate="anonymous-mask" title="experimental">Anonymous mask 👨‍🔬</option>
<option value="dog" data-translate="dog-face" title="experimental">Dog ears and nose 👨‍🔬</option>
</select>
<span data-warnSimdNotice="true" style='display:none; font-size: 140%; margin-left:10px; vertical-align: middle; cursor:pointer' title="Improve performance and quality with this tip" onclick="warnUser(`For improved performance, use Chrome v87 or newer with SIMD support enabled.<br />Enable SIMD here: <a href='chrome://flags/#enable-webassembly-simd' target='_blank' onclick='copyFunction(this,event)' >chrome://flags/#enable-webassembly-simd</a>`);">
<span data-warnSimdNotice="true" style='display:none; font-size: 140%; margin-left:10px; vertical-align: middle; cursor:pointer' title="Improve performance and quality with this tip" onclick="smdInfo();">
<i class="las la-info-circle"></i>
</span>
<span data-effectsNotice="true" style='display:none; font-size: 140%; margin-left:10px; vertical-align: middle; cursor:pointer' title="Improve performance and quality with this tip" onclick="warnUser('Use a Chromium Based Browser');">
@ -460,9 +479,9 @@
</span>
<div id="selectImageTFLITE" style="display:none;margin-top:10px;">
<img src="./media/bg_sample.webp" loading="lazy" style="max-width:130px;max-height:73.5px;display:inline-block:margin:10px;cursor:pointer;" onclick="changeTFLiteImage(event, this);"/>
<img src="./media/bg_sample2.webp" loading="lazy" style="max-width:130px;max-height:73.5px;display:inline-block:margin:10px;cursor:pointer;" onclick="changeTFLiteImage(event, this);"/>
<label style="width:130px;display:inline-block;margin:0 10px; text-align: center; cursor:pointer;">
<img src="./media/bg_sample.webp" loading="lazy" style="max-width:130px;max-height:73.5px;display:inline-block;margin:10px;cursor:pointer;" onclick="changeTFLiteImage(event, this);"/>
<img src="./media/bg_sample2.webp" loading="lazy" style="max-width:130px;max-height:73.5px;display:inline-block;margin:10px;cursor:pointer;" onclick="changeTFLiteImage(event, this);"/>
<label style="width:130px;display:inline-block;margin:0 1px; text-align: center; cursor:pointer;">
<i class="las la-hdd" style="font-size: 3em;"></i><br />Select Local Image
<input type="file" onchange="changeTFLiteImage(event, this)" accept="image/*" style="position: fixed; top: -100em; margin-left:10px; border:1px solid #555;">
</label>
@ -799,14 +818,14 @@
Some devices that use hardware encoding can experience video issues; switching to VP8 or VP9 as a <a target='_blank' title='Jump to the documentation' href='https://docs.vdo.ninja/viewers-settings/codec'>codec</a> may help.
</li>
<li>
Audio may drop out in OBS Studio at random times, yet still appear active. Delete the browser source and re-create, or use the <a href="https://github.com/steveseguin/electroncapture">Electron Capture</a> app instead</a>.
Audio may drop out in OBS Studio at random times, yet still appear active. Delete the browser source and re-create, or use the <a href="https://github.com/steveseguin/electroncapture">Electron Capture</a> app instead.
</li>
<br />
<h4>
<font style="color:#daad09;">Welcome to VDO Ninja! We've rebranded! Nothing else is changing and we're staying 100% free.</font>
</h4>
<br />
Site updated February 14th. <a target="_blank" href="https://docs.vdo.ninja/releases/v21">v21 release notes</a>. If having new issues, the previous version <a href="https://vdo.ninja/v20/">is here</a>, and the <a href="https://vdo.ninja/beta/">upcoming next version is here</a>; please test it when possible.
Site updated April 2022. <a target="_blank" href="https://docs.vdo.ninja/releases/v21">v21 release notes</a>. If having new issues, the previous version <a href="https://vdo.ninja/v20/">is here</a>, and the <a href="https://vdo.ninja/beta/">upcoming next version is here</a>; please test it when possible.
<br />
<br />
<h3>
@ -1246,11 +1265,11 @@
<span data-translate="solo-video">Highlight guest</span>
</button>
<font class="tooltip" style="height: 0; border: 0;">
<font class="tooltip" style="height: 0; border: 0;">
<input data-action-type="volume" type="range" min="0" max="200" value="100" title="Remotely change the volume of this guest" oninput="remoteVolumeUI(this)" ondblclick="this.value=100;remoteVolume(this);remoteVolumeUI(this);" onchange="remoteVolume(this);" style="grid-column: 2; margin:5px; width: 93%; position: relative;top: 0.6em; background-color:#fff0;"/><span class="tooltiptext" style='float: right; overflow: auto; left: 40px; width: 3em; top: -13px; margin: 0; position:relative;font-family:"Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", Times, Symbola, Aegyptus,Code2000, Code2001, Code2002, Musica, serif, LastResort;' >100</span>
</font>
<button data-action-type="mute-guest" title="Mute this guest everywhere" onclick="remoteMute(this, event);">
<button data-action-type="mute-guest" data-value="0" title="Mute this guest everywhere" onclick="remoteMute(this, event);">
<i class="las la-microphone-slash" style="color:#900"></i>
<span data-translate="mute-guest" >mute guest</span>
</button>
@ -1585,6 +1604,24 @@
</div>
<select id="outputSource3" ></select>
</span>
<div id="avatarDiv3" class="advanced">
<div style="text-align: left;display: inline-block;">
<i class="las la-robot"></i><span data-translate="select-avatar-image"> Default Avatar / Placeholder Image: </span>
</div>
<div id="selectAvatarImage3" style="margin-top:10px;">
<img src="./media/avatar.webp" loading="lazy" id="defaultAvatar2" style="max-width:130px;max-height:73.5px;display:inline-block;margin:10px;cursor:pointer;" onclick="changeAvatarImage(event, this);"/>
<label class="selected" id="noAvatarSelected3" style="width:130px;display:inline-block;margin:0 1px; text-align: center; cursor:pointer;">
<i class="las la-minus-circle" style="font-size: 3em;"></i><br />No Image Selected
<button onclick="changeAvatarImage(event, this)" style="position: fixed; top: -100em; margin-left:10px; border:1px solid #555;"></button>
</label>
<label style="width:130px;display:inline-block;margin:0 1px; text-align: center; cursor:pointer;">
<i class="las la-hdd" style="font-size: 3em;"></i><br />Select Local Image
<input type="file" onchange="changeAvatarImage(event, this)" accept="image/*" style="position: fixed; top: -100em; margin-left:10px; border:1px solid #555;">
</label>
</div>
</div>
<span id="effectsDiv3" style="display: none; user-select: none;">
<div class="title">
<i class="las la-robot"></i>
@ -1599,12 +1636,12 @@
<option value="anon" data-translate="anonymous-mask" title="experimental">Anonymous mask 👨‍🔬</option>
<option value="dog" data-translate="dog-face" title="experimental">Dog ears and nose 👨‍🔬</option>
</select>
<span data-warnSimdNotice="true" style='display:none; font-size: 140%; margin-left:10px; vertical-align: middle; cursor:pointer' title="Improve performance and quality with this tip" onclick="warnUser(`For improved performance, use Chrome v87 or newer with SIMD support enabled.<br />Enable SIMD here: <a href='chrome://flags/#enable-webassembly-simd' onclick='copyFunction(this,event)' target='_blank'>chrome://flags/#enable-webassembly-simd</a>`);">
<span data-warnSimdNotice="true" style='display:none; font-size: 140%; margin-left:10px; vertical-align: middle; cursor:pointer' title="Improve performance and quality with this tip" onclick="smdInfo();">
<i class="las la-info-circle"></i>
</span>
<div id="selectImageTFLITE3" style="display:none;margin-top:10px;">
<img src="./media/bg_sample.webp" loading="lazy" style="max-width:130px;max-height:73.5px;display:inline-block:margin:10px;cursor:pointer;" onclick="changeTFLiteImage(event, this);"/>
<img src="./media/bg_sample2.webp" loading="lazy" style="max-width:130px;max-height:73.5px;display:inline-block:margin:10px;cursor:pointer;" onclick="changeTFLiteImage(event, this);"/>
<img src="./media/bg_sample.webp" loading="lazy" style="max-width:130px;max-height:73.5px;display:inline-block;margin:10px;cursor:pointer;" onclick="changeTFLiteImage(event, this);"/>
<img src="./media/bg_sample2.webp" loading="lazy" style="max-width:130px;max-height:73.5px;display:inline-block;margin:10px;cursor:pointer;" onclick="changeTFLiteImage(event, this);"/>
<label style="width:130px;display:inline-block;margin:0 10px; text-align: center; cursor:pointer;">
<i class="las la-hdd" style="font-size: 3em;"></i><br /><span data-translate="select-local-image">Select Local Image</span>
<input type="file" accept="image/*" onchange="changeTFLiteImage(event, this)" style="position: fixed; top: -100em; margin-left:10px; border:1px solid #555;">
@ -1934,7 +1971,7 @@
var session = WebRTC.Media; // session is a required global variable if configuring manually. Run before loading main.js but after webrtc.js.
session.version = "21.4";
session.version = "22.0b";
session.streamID = session.generateStreamID(); // randomly generates a streamID for this session. You can set your own programmatically if needed
session.defaultPassword = "someEncryptionKey123"; // Change this password if self-deploying for added security/privacy
@ -2001,11 +2038,11 @@
// session.apiserver = "wss://api.vdo.ninja:443"; // specifiy a custom websocket API URL.
</script>
<script type="text/javascript" crossorigin="anonymous" src="./thirdparty/aes.js"></script>
<script type="text/javascript" crossorigin="anonymous" id="lib-js" src="./lib.js?ver=286"></script>
<script type="text/javascript" crossorigin="anonymous" id="lib-js" src="./lib.js?ver=294"></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=313"></script>
<script type="text/javascript" crossorigin="anonymous" id="main-js" src="./main.js?ver=322"></script>
</body>
</html>

2000
lib.js

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,7 @@
--video-margin: 0px;
--video-rounded: 0px;
--video-border: 0px;
--video-border-color: #444;
--video-border-color: #0000;
--video-rounded: 0px;
--color-mode: light;
--button-radius: 2px;
@ -488,11 +488,7 @@ hr {
width: 100%;
height: 100%;
overflow: hidden;
padding: var(--video-margin);
border-radius: var(--video-rounded);
border-width: var(--video-border);
border-color: var(--video-border-color);
border-style: solid;
}
#gridlayout {
@ -1671,7 +1667,9 @@ label {
.outer:hover .inner:after {
bottom: 0;
}
.microphoneBackground{
background-image: url("data:image/svg+xml,%0A%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M 13 4 C 11.90625 4 11 4.90625 11 6 L 11 18 C 11 19.09375 11.90625 20 13 20 L 19 20 C 20.09375 20 21 19.09375 21 18 L 21 6 C 21 4.90625 20.09375 4 19 4 Z M 13 6 L 19 6 L 19 18 L 13 18 Z M 7 14 L 7 18 C 7 21.300781 9.699219 24 13 24 L 15 24 L 15 26 L 11 26 L 11 28 L 21 28 L 21 26 L 17 26 L 17 24 L 19 24 C 22.300781 24 25 21.300781 25 18 L 25 14 L 23 14 L 23 18 C 23 20.21875 21.21875 22 19 22 L 13 22 C 10.78125 22 9 20.21875 9 18 L 9 14 Z'/%3E%3C/svg%3E")!important;
}
.advanced {
display: none !important;
}
@ -1738,11 +1736,6 @@ label {
}
}
img {
border-radius: 5px 5px 0 0;
margin: 5px;
}
#empty-container {
display: inline-block;
width: 20%;
@ -1895,6 +1888,7 @@ iframe {
img {
max-width: 100%;
}
.in-animation {
animation: inlightbox 0.5s forwards;
position: fixed !important;
@ -2061,12 +2055,17 @@ img {
height: 100%;
max-width: 100%;
max-height: 100%;
margin: auto;
object-fit: contain;
overflow:hidden;
display: flex;
align-items: center;
justify-content: center;
pointer-events: none;
margin: var(--video-margin);
border-radius: var(--video-rounded);
border-width: var(--video-border);
border-color: var(--video-border-color);
background-color: var(--video-border-color);
border-style: solid;
}
.fadein {
@ -2273,7 +2272,23 @@ audio.fileshare::-webkit-media-controls-play-button, video.fileshare::-webkit-me
background-color: #f3f3f3;
border: 1px solid #ccc;
}
.selected {
border: solid 3px black;
padding: 4px;
}
#avatarDiv {
user-select: none;
font-size:100%;
text-align:left;
margin: 17px auto;
max-width:450px;
min-width: 420px;
background-color: #f3f3f3;
display: block;
padding: 10px 10px;
border: 1px solid #ccc;
vertical-align: middle;
}
#effectsDiv {
user-select: none;
font-size:100%;
@ -2296,6 +2311,15 @@ audio.fileshare::-webkit-media-controls-play-button, video.fileshare::-webkit-me
vertical-align: middle;
margin: 17px 0 0 0;
}
#avatarDiv3 {
text-align: left;
width: 450px;
background-color: #f3f3f3;
padding: 10px 10px;
border: 1px solid #ccc;
vertical-align: middle;
margin: 17px 0 0 0;
}
#videoSettings {
margin: auto auto;
background-color: #f3f3f3;
@ -3742,6 +3766,8 @@ input:checked + .slider:before {
content: "\f06e"; }
.la-minus:before {
content: "\f068"; }
.la-minus-circle:before {
content: "\f056"; }
.la-plus:before {
content: "\f067"; }
.la-sync:before {

216
main.js
View File

@ -146,6 +146,14 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
}
}
if (urlParams.has('safemode')) {
session.safemode = true; // load defa
} else {
session.store = {};
loadSettings();
}
if (navigator.userAgent.toLowerCase().indexOf(' electron/') > -1) {
try {
getById("electronDragZone").style.cursor="grab";
@ -431,6 +439,14 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
session.midiHotkeys = parseInt(session.midiHotkeys);
}
if (urlParams.has('disablehotkeys')){
session.disableHotKeys = true;
}
if (urlParams.has('nohangupbutton') || urlParams.has('nohub')){
getById("hangupbutton").style.display = "none";
}
if (urlParams.has('midioffset')){
session.midiOffset = urlParams.get('midioffset') || 0;
session.midiOffset = parseInt(session.midiOffset);
@ -466,8 +482,7 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
if (session.midiDevice){
session.midiDevice = parseInt(session.midiDevice);
}
if (urlParams.has('webcam') || urlParams.has('wc') || urlParams.has('miconly')) {
session.webcamonly = true;
session.screensharebutton = false;
@ -477,6 +492,9 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
getById("add_camera").innerHTML = "Share your Microphone";
miniTranslate(getById("add_camera"), "share-your-mic");
getById("videoMenu").style.display = "none";
getById("container-3").classList.add("microphoneBackground");
//session.autostart = true;
getById("flipcamerabutton").style.setProperty("display", "none", "important");
getById("mutevideobutton").style.setProperty("display", "none", "important");
@ -556,11 +574,6 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
if (urlParams.has('hideguest') || urlParams.has('hidden')) {
session.directorVideoMuted = true;
}
if (urlParams.has('safemode')) {
session.safemode = true;
}
if (urlParams.has('videomute') || urlParams.has('videomuted') || urlParams.has('vm')) {
session.videoMutedFlag = true;
@ -568,7 +581,7 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
if (urlParams.has('layout')) {
try {
session.layout = JSON.parse(urlParams.has('layout'));
session.layout = JSON.parse(decodeURIComponent(urlParams.get('layout'))) || JSON.parse(urlParams.get('layout')) || false;
} catch(e){
session.layout = null
}
@ -715,6 +728,43 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
}
}
}
if (urlParams.has('autorecord')) {
session.autorecord=true;
if (session.recordLocal===false){
session.recordLocal = urlParams.get('record');
if (session.recordLocal != parseInt(session.recordLocal)) {
session.recordLocal = 6000;
} else {
session.recordLocal = parseInt(session.recordLocal);
}
}
}
if (urlParams.has('autorecordlocal')) {
session.autorecordlocal=true;
if (session.recordLocal===false){
session.recordLocal = urlParams.get('autorecordlocal');
if (session.recordLocal != parseInt(session.recordLocal)) {
session.recordLocal = 6000;
} else {
session.recordLocal = parseInt(session.recordLocal);
}
}
}
if (urlParams.has('autorecordremote')) {
session.autorecordremote=true;
if (session.recordLocal===false){
session.recordLocal = urlParams.get('autorecordremote');
if (session.recordLocal != parseInt(session.recordLocal)) {
session.recordLocal = 6000;
} else {
session.recordLocal = parseInt(session.recordLocal);
}
}
}
if (urlParams.has('pcm')) {
session.pcm = true;
}
@ -814,12 +864,73 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
getById("main").classList.remove('hidden');
}
if (urlParams.has('avatar')){
var avatar = urlParams.get('avatar') || false;
if (avatar && (avatar=="default")){
session.avatar = document.getElementById("defaultAvatar2");
session.avatar.ready=false;
session.avatar.onload = () => {
session.avatar.ready = true;
getById("noAvatarSelected3").classList.remove("selected");
getById("noAvatarSelected").classList.remove("selected");
getById("defaultAvatar1").classList.add("selected");
getById("defaultAvatar2").classList.add("selected");
};
if (session.avatar.complete){
session.avatar.ready = true;
getById("noAvatarSelected3").classList.remove("selected");
getById("noAvatarSelected").classList.remove("selected");
getById("defaultAvatar1").classList.add("selected");
getById("defaultAvatar2").classList.add("selected");
}
} else if (avatar){
avatar = decodeURI(avatar);
session.avatar = document.getElementById("defaultAvatar2");
session.avatar.ready = false;
session.avatar.onload = () => {
session.avatar.ready = true;
getById("noAvatarSelected3").classList.remove("selected");
getById("noAvatarSelected").classList.remove("selected");
getById("defaultAvatar1").classList.add("selected");
getById("defaultAvatar2").classList.add("selected");
};
document.getElementById("defaultAvatar1").src = avatar;
document.getElementById("defaultAvatar2").src = avatar;
}
document.getElementById("avatarDiv3").classList.remove("advanced");
document.getElementById("avatarDiv").classList.remove("advanced");
}
if (urlParams.has('js')){ // ie: &js=https%3A%2F%2Fvdo.ninja%2Fexamples%2Ftestjs.js
console.warn("Third-party Javascript has been injected into the code. Security cannot be ensured.");
var jsURL = urlParams.get('js');
jsURL = decodeURI(jsURL);
log(jsURL);
// type="text/javascript" crossorigin="anonymous"
var externalJavaascript = document.createElement('script');
externalJavaascript.type = 'text/javascript';
externalJavaascript.crossorigin = 'anonymous';
externalJavaascript.src = jsURL;
externalJavaascript.onerror = function() {
warnlog("Third-party Javascript failed to load");
};
externalJavaascript.onload = function() {
log("Third-party Javascript loaded");
};
document.head.appendChild(externalJavaascript);
}
if (urlParams.has("base64css") || urlParams.has("b64css") || urlParams.has("cssbase64") || urlParams.has("cssb64")) {
var base64Css = urlParams.get("base64css") || urlParams.get("b64css") || urlParams.get("cssbase64") || urlParams.get("cssb64");
var css = decodeURIComponent(atob(base64Css)); // window.btoa(encodeURIComponent("#mainmenu{background-color: pink; ❤" ));
var cssStyleSheet = document.createElement("style");
cssStyleSheet.innerText = css;
document.querySelector("head").appendChild(cssStyleSheet);
try {
var base64Css = urlParams.get("base64css") || urlParams.get("b64css") || urlParams.get("cssbase64") || urlParams.get("cssb64");
var css = decodeURIComponent(atob(base64Css)); // window.btoa(encodeURIComponent("#mainmenu{background-color: pink; ❤" ));
var cssStyleSheet = document.createElement("style");
cssStyleSheet.innerText = css;
document.querySelector("head").appendChild(cssStyleSheet);
} catch(e){console.error(e);}
};
session.sitePassword = session.defaultPassword;
@ -1524,19 +1635,17 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
if (urlParams.has('margin')) {
try {
var videoMargin = urlParams.get('margin') || 10;
videoMargin = parseInt(videoMargin);
videoMargin+="px";
document.querySelector(':root').style.setProperty('--video-margin', videoMargin);
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 {
var videoRounded = urlParams.get('rounded') || urlParams.get('round') || 50;
videoRounded = parseInt(videoRounded);
videoRounded+="px";
document.querySelector(':root').style.setProperty('--video-rounded', videoRounded);
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");}
}
@ -1547,15 +1656,17 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
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 {
var videoBorderColor = urlParams.get('bordercolor') || "#444";
document.querySelector(':root').style.setProperty('--video-border-color', videoBorderColor);
session.borderColor = urlParams.get('bordercolor') || "#000";
document.querySelector(':root').style.setProperty('--video-border-color', session.borderColor);
} catch(e){errorlog("variable css failed");}
}
@ -1636,6 +1747,7 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
log("session.videoDevice:" + session.videoDevice);
}
// audioDevice
if (urlParams.has('audiodevice') || urlParams.has('adevice') || urlParams.has('ad') || urlParams.has('device') || urlParams.has('d')) {
@ -1689,7 +1801,9 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
getById("container-3").classList.remove('pointer');
delayedStartupFuncs.push([previewWebcam]);
session.webcamonly = true;
}
} else {
getById("container-3").classList.add("microphoneBackground");
}
}
if (session.mobile){
@ -1894,6 +2008,17 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
session.h264profile = urlParams.get('h264profile') || "42e01f"; // 42001f
session.h264profile = session.h264profile.substring(0, 6);
session.h264profile = session.h264profile.toLowerCase();
if (session.h264profile=="0"){
session.h264profile = false;
} else if (session.h264profile=="off"){
session.h264profile = false;
} else if (session.h264profile=="disabl"){
session.h264profile = false;
} else if (session.h264profile=="defaul"){
session.h264profile = false;
} else if (session.h264profile=="false"){
session.h264profile = false;
}
}
if (urlParams.has('nonacks')){ // disables error control / throttling.
@ -2105,6 +2230,24 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
getById("headphonesDiv").style.display = "none";
getById("headphonesDiv2").style.display = "none";
} else if (session.sink){
if (session.sink == "default"){session.sink = false;}
else {
enumerateDevices().then(function(deviceInfos) {
var matched = false;
for (let i = 0; i !== deviceInfos.length; ++i) {
if (deviceInfos[i].kind === 'audiooutput') {
if (deviceInfos[i].deviceId == session.sink) {
matched = true;
break;
}
}
}
if (!matched){
session.sink = false; // make sure any saved output device exists.
}
});
}
}
if (window.obsstudio || (navigator.userAgent.toLowerCase().indexOf(' electron/') > -1)){
@ -2420,7 +2563,10 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
} else if (session.animatedMoves === "off") {
session.animatedMoves = false;
} else {
session.animatedMoves=true;
session.animatedMoves = parseInt(session.animatedMoves) || 100;
}
if (session.animatedMoves>200){
session.animatedMoves = 200;
}
} else if (session.mobile){
session.animatedMoves=false;
@ -2751,13 +2897,10 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
session.effects = null;
}
if (urlParams.has('effects') || urlParams.has('effect')) {
session.effects = urlParams.get('effects') || urlParams.get('effect') || null;
}
if (session.effects!==false){
if (session.effects === null){
getById("effectsDiv").style.display = "block";
@ -2794,7 +2937,6 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
session.effectValue_default = session.effectValue;
}
if (session.webcamonly == true) {
if (session.introButton){
getById("container-2").className = 'column columnfade advanced'; // Hide screen share
@ -2861,7 +3003,9 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
if (urlParams.get('screensharequality') || urlParams.get('ssq')) {
session.screensharequality = urlParams.get('screensharequality') || urlParams.get('ssq');
session.screensharequality = parseInt(session.screensharequality) || 0;
getById("gear_screen").parentNode.removeChild(getById("gear_screen"));
try {
getById("gear_screen").parentNode.removeChild(getById("gear_screen"));
} catch(e){}
}
}
@ -3643,10 +3787,20 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
}
}
if ("previewMode" in e.data){
if ("layout" in e.data){
session.layout = e.data.layout;
}
switchModes(e.data.previewMode);
}
if (("scene" in e.data) && ("layout" in e.data)){
warnlog("changing layout request via IFRAME API");
issueLayout(e.data.layout, e.data.scene);
if (session.director){
session.layout = e.data.layout; // not sure this is ideal, but whatever.
updateMixer();
}
}
@ -4115,6 +4269,8 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
} else {
AltPressed = false;
}
if (session.disableHotKeys){return;}
if (KeyPressedTimeout){
event.preventDefault(); event.stopPropagation();

2375
mixer.html

File diff suppressed because one or more lines are too long

View File

@ -77,6 +77,7 @@
<option value="aus1">Sydney, Australia</option>
<option value="jap1">Tokyo, Japan</option>
<option value="sing1">Singapore</option>
<option value="ind1">Mumbai, India</option>
</select>
<br /><br /><br />
</div>

File diff suppressed because one or more lines are too long