Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
steveseguin authored Jan 23, 2023
1 parent 13d5e80 commit d36d110
Show file tree
Hide file tree
Showing 16 changed files with 1,624 additions and 472 deletions.
2 changes: 2 additions & 0 deletions check.html
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,8 @@ <h3>Packet Loss (%)</h3>
)[0].style.display = "inline";


logData({"timestart": Date.now()});

var showdetails = document.createElement("button");
showdetails.onclick = function(){
document.getElementById("graphs").classList.toggle('hidden');
Expand Down
67 changes: 34 additions & 33 deletions comms.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
height: 100%;
width: 1280px;

max-height: calc(100vh - 95px);
max-height: calc(100vh - 92px);

background-color: #0002;
border-radius: 3px;
Expand All @@ -52,8 +52,8 @@
}

iframe.aspectRatio{
max-height: min(calc(100vh - 80px), calc(100vw - var(--chat-width)) / var(--aspect-ratio))) !important;
max-width: min(calc((100vh - 80px) * var(--aspect-ratio)), calc(100vw - var(--chat-width))) !important;
max-height: min(calc(100vh - 92px), calc(100vw - 160px - var(--chat-width)) / var(--aspect-ratio)) !important;
max-width: min(calc((100vh - 92px) * var(--aspect-ratio)), calc(100vw - 160px - var(--chat-width))) !important;
height: 720px;
width: 1280px;
}
Expand Down Expand Up @@ -128,29 +128,29 @@
bottom: 0;
position: fixed;
margin: 10px;
margin-left:0;
align-self: center;
width: var(--chat-width);
max-width: calc(100% - 40px);
width: 400px;
max-width: 100%;
z-index:3;
height: calc(100vh - 40px);
overflow: hidden;
right:0;
background:#0008;
background:#0001;
border: solid 2px #0005;
border-radius: 10px;
padding: 10px;
transition: all .05s ease-in-out;
max-height: 95vh;
}
#chatInput {
display: inline-block;
color: #000;
background-color: #FFFE;
width: 324px;
font-size: 105%;
margin-left: 3px;
max-width: calc(100% - 76px);
margin-left: 7px;
}
#chatSendBar{
display: inline-block;
Expand Down Expand Up @@ -199,7 +199,7 @@
#containerMenu{
position: absolute;
left: 0px;
width: calc(100vw - var(--chat-width));
width: calc(100vw - var(--chat-width) - 40px + var(--chat-filler));
display: flex;
top: 0;
height: 100px;
Expand All @@ -214,7 +214,7 @@
#vdoninja {
max-width: calc(100vw - 54px - var(--chat-width) + var(--chat-filler));
width: 100vw;
height: calc(100vh - 117px);
height: calc(100vh - 112px);
}

#viewlink {
Expand Down Expand Up @@ -306,7 +306,7 @@
border-radius: 10px;
box-shadow: 2px 2px 6px #273a4e, -2px -2px 6px #354e6a;
width: 135px;
height: 60px;
height: 50px;
background-color: #0004;
display: inline-block;
margin: 5px 10px 0 10px;
Expand All @@ -328,7 +328,8 @@
}

::-webkit-scrollbar {
width: 15px;
width: 12px;
height: 12px;
}

::-webkit-scrollbar-track {
Expand Down Expand Up @@ -372,7 +373,7 @@
top: 92px;
}
.tFadeStart{
top: 107px;
top: 102px;
}

@keyframes tFadeOut {
Expand Down Expand Up @@ -443,6 +444,9 @@
position: absolute;
}

h3 {
margin-bottom: 6px;
}
.settings {
display: block;
background: #c0e3ff;
Expand Down Expand Up @@ -510,7 +514,7 @@
user-select: none;
}
.pressed>.group{
border: solid 2px black;
box-shadow: inset 2px 2px 10px #0007, inset -2px -2px 10px #0007;
background-color: #276022aa;
}
button.pressed {
Expand Down Expand Up @@ -731,45 +735,42 @@
background-color:#0000;
}
#containermenu>div:nth-child(1)>div::before {
content: "0";
color: #a4a4a4;
}
#containermenu>div:nth-child(2)>div::before {
content: "1";
color: #a4a4a4;
}
#containermenu>div:nth-child(3)>div::before {
#containermenu>div:nth-child(2)>div::before {
content: "2";
color: #a4a4a4;
}
#containermenu>div:nth-child(4)>div::before {
#containermenu>div:nth-child(3)>div::before {
content: "3";
color: #a4a4a4;
}
#containermenu>div:nth-child(5)>div::before {
#containermenu>div:nth-child(4)>div::before {
content: "4";
color: #a4a4a4;
}
#containermenu>div:nth-child(6)>div::before {
#containermenu>div:nth-child(5)>div::before {
content: "5";
color: #a4a4a4;
}
#containermenu>div:nth-child(7)>div::before {
#containermenu>div:nth-child(6)>div::before {
content: "6";
color: #a4a4a4;
}
#containermenu>div:nth-child(8)>div::before {
#containermenu>div:nth-child(7)>div::before {
content: "7";
color: #a4a4a4;
}
#containermenu>div:nth-child(9)>div::before {
#containermenu>div:nth-child(8)>div::before {
content: "8";
color: #a4a4a4;
}
#containermenu>div:nth-child(10)>div::before {
#containermenu>div:nth-child(9)>div::before {
content: "9";
color: #a4a4a4;
}

#containermenu>div>div {
width: 15px;
height: 15px;
Expand Down Expand Up @@ -1003,7 +1004,7 @@

if (document.getElementById("chatModule").classList.contains("hidden")){
document.documentElement.style.setProperty('--chat-width', "0px");
document.documentElement.style.setProperty('--chat-filler', "33px");
document.documentElement.style.setProperty('--chat-filler', "40px");

} else {
document.documentElement.style.setProperty('--chat-width', "400px");
Expand Down Expand Up @@ -1689,11 +1690,11 @@

function hotkeyCheck(event){
if (event.target && (event.target.tagName == "INPUT")){warnlog("input in focus; return");return;}
var value = parseInt(event.key);
if (value == event.key){
var value = parseInt(event.key)-1;
if (value+1 == event.key){
try {
if (document.querySelector("#containermenu").children[value]){
document.querySelector("#containermenu").children[value].querySelector("group").click();
document.querySelector("#containermenu").children[value].querySelector(".group").click();
document.querySelector("#containermenu").children[value].classList.add("shake");
setTimeout(function(ele){ele.classList.remove("shake");},500,document.querySelector("#containermenu").children[value]);
}
Expand Down Expand Up @@ -2004,7 +2005,7 @@
<!-- }); -->
<!-- this.dataset.state = "active"; -->
<!-- addgroup2(this); -->
<!-- addOldElement(JSON.parse(this.parentNode.querySelector("group").group)); -->
<!-- addOldElement(JSON.parse(this.parentNode.querySelector(".group").group)); -->
<!-- } -->

var hotkey = document.createElement("div");
Expand Down
2 changes: 1 addition & 1 deletion examples/dual.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
var room2 = "https://"+path+"/../?room="+roomname+"&push="+roomname+"_rear&webcam&autostart&vd=back&ad=0&view&cleanoutput&nosettings&transparent";

var iframe = document.createElement("iframe");
iframe.allow = "autoplay;camera;microphone;fullscreen;picture-in-picture;";
iframe.allow = "document-domain;encrypted-media;sync-xhr;usb;web-share;cross-origin-isolated;accelerometer;midi;geolocation;autoplay;camera;microphone;fullscreen;picture-in-picture;display-capture;";
iframe.src = room1;
var iframeContainer = document.createElement("div");
iframeContainer.appendChild(iframe);
Expand Down
146 changes: 146 additions & 0 deletions examples/overlay.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
<html>
<head><title>overlay + Video</title>
<meta name="viewport" content="width=device-width, initial-scale=0.7, maximum-scale=1.0, user-scalable=yes" />
<meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
<style>
body{
padding:0;
margin:0;
background-color:#003;
width:100%;
height:100%;
color:white;
}

iframe {
width:100vw;
height:100vh;
border:0;
margin:0;
padding:0;
position:fixed;
top:0;
left:0
}


input{
padding:10px;
width:80%;
font-size:1.2em;
z-index: 1000;
}

h1{
color: white;
font-family: verdana;
margin: 10px;
}


</style>
</head>
<body>


<div id="clean">
<h1>Apply an Overlay to VDO.Ninja</h1>
<input placeholder="Enter a VDON URL here" id="viewlink" type="text" />
<input placeholder="Enter the Overlay page here" id="overlay" type="text" />
<button onclick="loadIframes()" style="display:block;padding:10px;margin:10px;">START</button>(Leave blank and press start to see a default sample result)
</div>
<script>

window.addEventListener("orientationchange", function() {
// Announce the new orientation number
// alert(window.orientation);
}, false);

function removeStorage(cname){
localStorage.removeItem(cname);
}

function setStorage(cname, cvalue, hours=9999){ // not actually a cookie
var now = new Date();
var item = {
value: cvalue,
expiry: now.getTime() + (hours * 60 * 60 * 1000),
};
try{
localStorage.setItem(cname, JSON.stringify(item));
}catch(e){errorlog(e);}
}

function getStorage(cname) {
try {
var itemStr = localStorage.getItem(cname);
} catch(e){
errorlog(e);
return;
}
if (!itemStr) {
return "";
}
var item = JSON.parse(itemStr);
var now = new Date();
if (now.getTime() > item.expiry) {
localStorage.removeItem(cname);
return "";
}
return item.value;
}
if (getStorage("overlayChatLink")){
document.getElementById("overlay").value = getStorage("overlayChatLink");
}
if (getStorage("vdoNinjaoverlayURL")){
document.getElementById("viewlink").value = getStorage("vdoNinjaoverlayURL");
}

function loadIframes(url=false){

var roomname = document.getElementById("viewlink").value;
var overlay = document.getElementById("overlay").value;

document.getElementById("clean").parentNode.removeChild(document.getElementById("clean"));

if (!roomname){
var room1 = "../";
} else if (roomname.startsWith("https://")){
var room1 = roomname;
} else {
var room1 = "https://"+roomname;
}

var iframe = document.createElement("iframe");
iframe.allow = "document-domain;encrypted-media;sync-xhr;usb;web-share;cross-origin-isolated;accelerometer;midi;geolocation;autoplay;camera;microphone;fullscreen;picture-in-picture;display-capture;";
iframe.src = room1;
document.body.appendChild(iframe);


if (!overlay){
var room2 = "./test_overlay";
} else if (overlay.startsWith("https://")){
var room2 = overlay;
} else {
var room2 = "https://"+overlay;
}

var iframe = document.createElement("iframe");
iframe.allow = "document-domain;encrypted-media;sync-xhr;usb;web-share;cross-origin-isolated;accelerometer;midi;geolocation;autoplay;camera;microphone;fullscreen;picture-in-picture;display-capture;";
iframe.src = room2;
iframe.style.pointerEvents = "none";
iframe.style.backgroundColor = "#0000";
iframe.style.width = "25vw";
iframe.style.height = "25vh";
iframe.style.overflow = "hidden";
document.body.appendChild(iframe);

if (roomname && overlay){
setStorage("overlayChatLink", room2);
setStorage("vdoNinjaoverlayURL", room1);
}
}

</script>
</body>
</html>
Loading

1 comment on commit d36d110

@steveseguin
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is synced to production vdo.ninja, which has been running live and stable for 2 months now.

Please sign in to comment.