mirror of
https://github.com/eliasstepanik/vdo.ninja.git
synced 2026-01-14 23:28:30 +00:00
Add files via upload
This commit is contained in:
parent
bc6f4f08fc
commit
be3bb3e532
22
index.html
22
index.html
@ -55,7 +55,7 @@
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" href="./lineawesome/css/line-awesome.min.css" />
|
||||
<link rel="stylesheet" href="./main.css?ver=54" />
|
||||
<link rel="stylesheet" href="./main.css?ver=56" />
|
||||
<script type="text/javascript" crossorigin="anonymous" src="./thirdparty/adapter.min.js"></script>
|
||||
</head>
|
||||
<body id="main" class="hidden">
|
||||
@ -67,7 +67,7 @@
|
||||
<link itemprop="url" href="./media/obsNinja_logo_full.png" />
|
||||
</span>
|
||||
<script type="text/javascript" crossorigin="anonymous" src="./thirdparty/CodecsHandler.js?ver=31"></script>
|
||||
<script type="text/javascript" crossorigin="anonymous" src="./webrtc.js?ver=183"></script>
|
||||
<script type="text/javascript" crossorigin="anonymous" src="./webrtc.js?ver=184"></script>
|
||||
<input id="zoomSlider" type="range" style="display: none;" />
|
||||
<div id="header">
|
||||
|
||||
@ -307,10 +307,7 @@
|
||||
<span><i class="las la-headphones"></i><span>You are using headphones / earphones</span></span>
|
||||
</span>
|
||||
<span id="videoMenu" class="videoMenu">
|
||||
<div class="title">
|
||||
<i class="las la-video"></i>
|
||||
<span data-translate="video-source">Video Source</span>
|
||||
</div>
|
||||
<i class="las la-video"></i><span data-translate="video-source"> Video Source </span>
|
||||
<select id="videoSourceSelect" ></select>
|
||||
<span id="gear_webcam" style="display: inline-block; cursor:pointer;" onclick="toggle(document.getElementById('videoSettings'));">
|
||||
|
||||
@ -982,7 +979,7 @@
|
||||
<label class="switch">
|
||||
<input type="checkbox" id="codech264toggle" data-param="&codec=h264" onchange="updateLink(3,this);">
|
||||
<span class="slider"></span>
|
||||
</label><font class="tooltip" style='cursor: help;position:relative;bottom:2px;font-family:"Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", Times, Symbola, Aegyptus, Code2000, Code2001, Code2002, Musica, serif, LastResort;'>💉<span class="tooltiptext" style="width: 10em; background-color: #77C"><span data-translate="this-can-reduce-packet-loss">This can reduce video corruption caused by packet loss</span></span></font>
|
||||
</label><font class="tooltip" style='cursor: help;position:relative;bottom:2px;font-family:"Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", Times, Symbola, Aegyptus, Code2000, Code2001, Code2002, Musica, serif, LastResort;'>💉<span class="tooltiptext" style="width: 10em; background-color: #77C"><span data-translate="this-can-reduce-packet-loss">Can reduce packet loss video corruption in OBS on PC</span></span></font>
|
||||
<span data-translate="use-h264-codec">Use H264 codec</span>
|
||||
|
||||
</div>
|
||||
@ -1079,7 +1076,7 @@
|
||||
|
||||
<button data-action-type="addToScene" class="hidden" data-cluster="1" style="grid-column: 1;" data-scene="2" title="Add this Video to any remote '&scene=2'" onclick="directEnable(this, event, 2);">
|
||||
<i class="las la-plus-square" style="color:#060"></i>
|
||||
<span data-translate="add-to-scene">add to scene 2</span>
|
||||
<span data-translate="add-to-scene2">add to scene 2</span>
|
||||
</button>
|
||||
|
||||
<button data-action-type="mute-scene" class="hidden" data-cluster="1" title="Remotely Mute this Audio in all remote '&scene' views" onclick="directMute(this, event);">
|
||||
@ -1345,7 +1342,7 @@
|
||||
</ul>
|
||||
</div>
|
||||
<br />
|
||||
<span id="headphonesDiv3" style="display: inline-block;">
|
||||
<span id="headphonesDiv3" style="display: block;">
|
||||
<div class="title">
|
||||
<i class="las la-headphones"></i>
|
||||
<span data-translate="select-output-source"> Audio Output Destination: </span>
|
||||
@ -1483,7 +1480,8 @@
|
||||
</div>
|
||||
|
||||
<div id="connectUsers">
|
||||
<div><u ><span data-translate="invisible-guests">Not Visible</span></u></div>
|
||||
<div style="margin-bottom:5px"><u ><span data-translate="invisible-guests">Not Visible</span></u>
|
||||
<span title="Hide this window" style="cursor:pointer;font-size:1.2em; float: right;" onclick="session.showList=false;getById('connectUsers').style.display = 'none';"><i class="las la-times"></i></span></div>
|
||||
<span style="height:5px;display:block;"></span>
|
||||
<div id="userList">
|
||||
</div>
|
||||
@ -1556,7 +1554,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 = "17.0";
|
||||
session.version = "17.1";
|
||||
session.streamID = session.generateStreamID(); // randomly generates a streamID for this session. You can set your own programmatically if needed
|
||||
|
||||
session.defaultPassword = "someEncryptionKey123"; // Disabling improves compatibility and is helpful for debugging.
|
||||
@ -1626,7 +1624,7 @@
|
||||
<script type="text/javascript" id="main-js" src="./main.js" data-translation="blank"></script>
|
||||
<script type="text/javascript" crossorigin="anonymous" id="mixer-js" src="./mixer.js?ver=2"></script>
|
||||
-->
|
||||
<script type="text/javascript" crossorigin="anonymous" id="main-js" src="./main.js?ver=190"></script>
|
||||
<script type="text/javascript" crossorigin="anonymous" id="main-js" src="./main.js?ver=192"></script>
|
||||
<script type="text/javascript">
|
||||
setTimeout(function(){ // lazy load
|
||||
var script = document.createElement('script');
|
||||
|
||||
18
main.css
18
main.css
@ -1090,12 +1090,6 @@ input[type=range]:focus::-ms-fill-upper {
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
#popupSelector .title {
|
||||
margin-bottom: 10px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
#audioSourceScreenshare {
|
||||
display:block;
|
||||
height: 60px;
|
||||
@ -1691,7 +1685,7 @@ video.clean::-webkit-media-controls-timeline-container {
|
||||
}
|
||||
#headphonesDiv3 {
|
||||
text-align: left;
|
||||
margin: 17px 0;
|
||||
margin: 17px 0 0 0;
|
||||
width: 450px;
|
||||
background-color: #f3f3f3;
|
||||
padding: 10px 10px;
|
||||
@ -1720,12 +1714,12 @@ video.clean::-webkit-media-controls-timeline-container {
|
||||
|
||||
#effectsDiv3 {
|
||||
text-align: left;
|
||||
margin: 0;
|
||||
width: 450px;
|
||||
background-color: #f3f3f3;
|
||||
padding: 10px 10px;
|
||||
border: 1px solid #ccc;
|
||||
vertical-align: middle;
|
||||
margin: 17px 0 0 0;
|
||||
}
|
||||
#videoSettings {
|
||||
margin: auto auto;
|
||||
@ -1831,6 +1825,7 @@ video.clean::-webkit-media-controls-timeline-container {
|
||||
vertical-align: middle;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
div.multiselect {
|
||||
width: 450px;
|
||||
white-space: nowrap;
|
||||
@ -2677,13 +2672,16 @@ input:checked + .slider:before {
|
||||
max-width: 400px;
|
||||
min-width: 150px;
|
||||
max-height: 80%;
|
||||
background-color: white;
|
||||
background-color: #08090e;
|
||||
z-index: 5;
|
||||
padding: 10px;
|
||||
right: 20px;
|
||||
bottom: 120px;
|
||||
box-shadow: 2px 2px #000;
|
||||
box-shadow: 2px 2px #313131;
|
||||
border-radius: 5px;
|
||||
border: 1px solid #252525;
|
||||
opacity: 0.7;
|
||||
color: white;
|
||||
}
|
||||
|
||||
#alertModal a:link {
|
||||
|
||||
122
main.js
122
main.js
@ -2116,11 +2116,13 @@ if (urlParams.has('quality') || urlParams.has('q')) {
|
||||
if (urlParams.has('sink')) {
|
||||
session.sink = urlParams.get('sink');
|
||||
} else if (urlParams.has('outputdevice') || urlParams.has('od') || urlParams.has('audiooutput')) {
|
||||
session.outputDevice = urlParams.get('outputdevice') || urlParams.get('od') || urlParams.get('audiooutput');
|
||||
session.outputDevice = urlParams.get('outputdevice') || urlParams.get('od') || urlParams.get('audiooutput') || null;
|
||||
|
||||
if (session.outputDevice) {
|
||||
session.outputDevice = session.outputDevice.toLowerCase().replace(/[\W]+/g, "_");
|
||||
} else {
|
||||
session.outputDevice = false;
|
||||
session.outputDevice = null;
|
||||
getById("headphonesDiv3").style.display = "none"; //
|
||||
}
|
||||
|
||||
if (session.outputDevice) {
|
||||
@ -2138,6 +2140,9 @@ if (urlParams.has('sink')) {
|
||||
});
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
getById("headphonesDiv").style.display = "none";
|
||||
getById("headphonesDiv2").style.display = "none";
|
||||
}
|
||||
|
||||
if (urlParams.has('fullscreen')) {
|
||||
@ -2336,11 +2341,18 @@ if (urlParams.has('icefilter')) {
|
||||
|
||||
|
||||
if (urlParams.has('effects') || urlParams.has('effect')) {
|
||||
session.effects = urlParams.get('effects') || urlParams.get('effect') || 0;
|
||||
session.effects = parseInt(session.effects);
|
||||
|
||||
if (session.effects === 0){
|
||||
session.effects = urlParams.get('effects') || urlParams.get('effect') || null;
|
||||
if (session.effects === null){
|
||||
getById("effectsDiv").style.display = "block";
|
||||
session.effects = 0;
|
||||
} else if (session.effects === "0" || session.effects === "false" || session.effects === "off"){
|
||||
session.effects = false;
|
||||
getById("effectSelector3").style.display = "none";
|
||||
getById("effectsDiv3").style.display = "none";
|
||||
getById("effectSelector").style.display = "none";
|
||||
getById("effectsDiv").style.display = "none";
|
||||
} else {
|
||||
session.effects = parseInt(session.effects);
|
||||
}
|
||||
|
||||
if (session.effects === 5){
|
||||
@ -4493,6 +4505,8 @@ function drawFace() {
|
||||
|
||||
async function detect() {
|
||||
|
||||
if (session.effects !== 1){return;}
|
||||
|
||||
ctx_tmp.drawImage(vid, 0, 0, vid.videoWidth, vid.videoHeight);
|
||||
image.src = canvas_tmp.toDataURL();
|
||||
await faceDetector.detect(image).then(faces => {
|
||||
@ -4521,6 +4535,9 @@ function drawFace() {
|
||||
}
|
||||
|
||||
function draw() {
|
||||
|
||||
if (session.effects !== 1){return;}
|
||||
|
||||
canvas.height = vid.videoHeight;
|
||||
canvas.width = vid.videoWidth;
|
||||
|
||||
@ -4664,7 +4681,7 @@ if ((session.roomid) || (urlParams.has('roomid')) || (urlParams.has('r')) || (ur
|
||||
}
|
||||
}
|
||||
|
||||
if (session.audioDevice === false) {
|
||||
if (session.audioDevice === false && session.outputDevice === false) {
|
||||
getById("headphonesDiv2").style.display = "inline-block";
|
||||
getById("headphonesDiv").style.display = "inline-block";
|
||||
}
|
||||
@ -6247,7 +6264,6 @@ function publishScreen() {
|
||||
, video: {
|
||||
width: width
|
||||
, height: height
|
||||
, mediaSource: "screen"
|
||||
}
|
||||
};
|
||||
|
||||
@ -6261,12 +6277,21 @@ function publishScreen() {
|
||||
constraints.audio.echoCancellation = true; // the defaults for screen publishing should be off.
|
||||
}
|
||||
|
||||
if (session.nocursor) {
|
||||
constraints.video.cursor = {
|
||||
exact: "none"
|
||||
}; // Not sure this does anything, but whatever.
|
||||
try {
|
||||
let supportedConstraints = navigator.mediaDevices.getSupportedConstraints(); // cursor hidding isn't supported by most browsers anyways.
|
||||
if (supportedConstraints.cursor) {
|
||||
constraints.video.cursor = "never";
|
||||
}
|
||||
} catch(e){
|
||||
warnlog("navigator.mediaDevices.getSupportedConstraints() not supported");
|
||||
}
|
||||
|
||||
//if (session.nocursor) { // we assume no cursor on screen share anyways. maybe make a different flag for screenshare cursor
|
||||
// constraints.video.cursor = {
|
||||
// exact: "none"
|
||||
// }; // Not sure this does anything, but whatever.
|
||||
//}
|
||||
|
||||
if (session.framerate !== false) {
|
||||
constraints.video.frameRate = session.framerate;
|
||||
} else if (session.maxframerate != false){
|
||||
@ -7444,7 +7469,7 @@ function createRoomCallback(passAdd, passAdd2) {
|
||||
session.updateLocalStatsInterval = setInterval(function(){updateLocalStats();},3000);
|
||||
|
||||
if (session.autostart){
|
||||
press2talk(true);
|
||||
setTimeout(function(){press2talk(true);},400);
|
||||
} else {
|
||||
session.seeding=true;
|
||||
session.seedStream();
|
||||
@ -9754,7 +9779,6 @@ async function grabScreen(quality = 0, audio = true, videoOnEnd = false) {
|
||||
, video: {
|
||||
width: width
|
||||
, height: height
|
||||
, mediaSource: "screen"
|
||||
}
|
||||
//,cursor: {exact: "none"}
|
||||
};
|
||||
@ -11934,10 +11958,10 @@ function updateConstraintSliders() {
|
||||
listCameraSettings();
|
||||
if ((iOS) || (iPad)){
|
||||
} else {
|
||||
getById("effectsDiv3").style.display = "block";
|
||||
if (session.effects){
|
||||
if (session.effects!==false){
|
||||
getById("effectsDiv3").style.display = "block";
|
||||
try{
|
||||
getById("effectSelector3").value = parseInt(session.effects)+"";
|
||||
getById("effectSelector3").value = parseInt(session.effects || 0)+"";
|
||||
} catch(E){}
|
||||
}
|
||||
}
|
||||
@ -16042,25 +16066,15 @@ function attemptTFLiteJsFileLoad(){
|
||||
TFLITELOADING=true;
|
||||
session.tfliteModule={};
|
||||
|
||||
if (getChromeVersion()>=77){
|
||||
if (!document.getElementById("tflitesimdjs")){
|
||||
var tmpScript = document.createElement('script');
|
||||
tmpScript.onload = loadTFLiteModel;
|
||||
tmpScript.type = 'text/javascript';
|
||||
tmpScript.src = "./thirdparty/tflite/tflite-simd.js";
|
||||
tmpScript.id = "tflitesimdjs";
|
||||
document.head.appendChild(tmpScript);
|
||||
}
|
||||
} else {
|
||||
if (!document.getElementById("tflitejs")){
|
||||
var tmpScript = document.createElement('script');
|
||||
tmpScript.onload = loadTFLiteModel;
|
||||
tmpScript.type = 'text/javascript';
|
||||
tmpScript.src = "./thirdparty/tflite/tflite.js";
|
||||
tmpScript.id = "tflitejs";
|
||||
document.head.appendChild(tmpScript);
|
||||
}
|
||||
if (!document.getElementById("tflitesimdjs")){
|
||||
var tmpScript = document.createElement('script');
|
||||
tmpScript.onload = loadTFLiteModel;
|
||||
tmpScript.type = 'text/javascript';
|
||||
tmpScript.src = "./thirdparty/tflite/tflite-simd.js?ver=2";
|
||||
tmpScript.id = "tflitesimdjs";
|
||||
document.head.appendChild(tmpScript);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
async function changeTFLiteImage(ev, ele){
|
||||
@ -16079,51 +16093,25 @@ async function changeTFLiteImage(ev, ele){
|
||||
}
|
||||
}
|
||||
|
||||
var SIMD_SUPPORT = null;
|
||||
|
||||
async function loadTFLiteModel(){
|
||||
try{
|
||||
if (session.tfliteModule && (session.tfliteModule.img)){
|
||||
var img = session.tfliteModule.img;
|
||||
if (SIMD_SUPPORT!==false){
|
||||
session.tfliteModule = await createTFLiteSIMDModule();
|
||||
} else {
|
||||
session.tfliteModule = await createTFLiteModule();
|
||||
}
|
||||
session.tfliteModule = await createTFLiteSIMDModule();
|
||||
session.tfliteModule.img = img;
|
||||
} else {
|
||||
session.tfliteModule = {};
|
||||
if (SIMD_SUPPORT!==false){
|
||||
session.tfliteModule = await createTFLiteSIMDModule();
|
||||
} else {
|
||||
session.tfliteModule = await createTFLiteModule();
|
||||
}
|
||||
session.tfliteModule = await createTFLiteSIMDModule();
|
||||
}
|
||||
if (SIMD_SUPPORT===null){
|
||||
SIMD_SUPPORT=true;
|
||||
log("WASM-SIMD SUPPORTED");
|
||||
}
|
||||
} catch(e){
|
||||
if (SIMD_SUPPORT===null){
|
||||
warnlog("WASM-SIMD NOT SUPPORTED");
|
||||
SIMD_SUPPORT=false;
|
||||
setTimeout(function(){
|
||||
warnlog("LOADING NON-SIMD");
|
||||
if (!document.getElementById("tflitejs")){
|
||||
var tmpScript = document.createElement('script');
|
||||
tmpScript.onload = loadTFLiteModel;
|
||||
tmpScript.type = 'text/javascript';
|
||||
tmpScript.src = "./thirdparty/tflite/tflite.js";
|
||||
tmpScript.id = "tflitejs";
|
||||
document.head.appendChild(tmpScript);
|
||||
}
|
||||
},0);
|
||||
if (!session.tfliteModule.simd){
|
||||
var elements = document.querySelectorAll('[data-warnSimdNotice]')
|
||||
for (let i = 0; i < elements.length; i++) {
|
||||
elements[i].style.display = "inline-block";
|
||||
}
|
||||
} else {
|
||||
warnlog("TF-LITE FAILED TO LOAD");
|
||||
}
|
||||
} catch(e){
|
||||
warnlog("TF-LITE FAILED TO LOAD");
|
||||
return;
|
||||
}
|
||||
const modelResponse = await fetch("./thirdparty/tflite/segm_full_v679.tflite");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user