mirror of
https://github.com/eliasstepanik/vdo.ninja.git
synced 2026-01-10 21:28:34 +00:00
stats fix
This commit is contained in:
parent
25015a33a3
commit
9a95a957c0
58
check.html
58
check.html
@ -157,10 +157,6 @@
|
||||
return raw ? parseInt(raw[2], 10) : false;
|
||||
}
|
||||
|
||||
if (!getChromeVersion()){
|
||||
alert("This speedtest is optimized for Chromium-based browsers; graphs will not work for Firefox or Safari browsers.");
|
||||
}
|
||||
|
||||
function next1(){
|
||||
document.getElementById("page1").classList.add("hidden");
|
||||
document.getElementById("page2").classList.remove("hidden");
|
||||
@ -285,8 +281,6 @@
|
||||
var statsSent = false;
|
||||
|
||||
eventer(messageEvent, function (e) {
|
||||
|
||||
console.log(e.data);
|
||||
if ("action" in e.data) {
|
||||
|
||||
if (e.data.action == "available-speedtest-servers"){
|
||||
@ -346,50 +340,55 @@
|
||||
if ("stats" in e.data) {
|
||||
var out = "";
|
||||
|
||||
for (var streamID in e.data.stats.inbound_stats) {
|
||||
out += printValues(e.data.stats.inbound_stats[streamID]);
|
||||
if (e.data.stats.inbound_stats[streamID]){
|
||||
for (var someValue in e.data.stats.inbound_stats) {
|
||||
out += printValues(e.data.stats.inbound_stats[someValue]);
|
||||
if (e.data.stats.inbound_stats[someValue]){
|
||||
if (!statsSent){
|
||||
statsSent = e.data.stats.inbound_stats[streamID];
|
||||
statsSent = e.data.stats.inbound_stats[someValue];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (var streamID in e.data.stats.outbound_stats) {
|
||||
if (e.data.stats.outbound_stats[streamID].quality_limitation_reason){
|
||||
if (quality_reason != e.data.stats.outbound_stats[streamID].quality_limitation_reason) {
|
||||
quality_reason = e.data.stats.outbound_stats[streamID].quality_limitation_reason;
|
||||
for (var someValue in e.data.stats.outbound_stats) {
|
||||
if (e.data.stats.outbound_stats[someValue].quality_limitation_reason){
|
||||
if (quality_reason != e.data.stats.outbound_stats[someValue].quality_limitation_reason) {
|
||||
quality_reason = e.data.stats.outbound_stats[someValue].quality_limitation_reason;
|
||||
logData({"QLR": quality_reason});
|
||||
}
|
||||
}
|
||||
|
||||
if (e.data.stats.outbound_stats[streamID].encoder){
|
||||
if (encoder != e.data.stats.outbound_stats[streamID].encoder) {
|
||||
encoder = e.data.stats.outbound_stats[streamID].encoder;
|
||||
if (e.data.stats.outbound_stats[someValue].encoder){
|
||||
if (encoder != e.data.stats.outbound_stats[someValue].encoder) {
|
||||
encoder = e.data.stats.outbound_stats[someValue].encoder;
|
||||
logData({"encoder":encoder});
|
||||
}
|
||||
} else if (e.data.stats.outbound_stats[someValue].video_codec){
|
||||
if (encoder != e.data.stats.outbound_stats[someValue].video_codec) {
|
||||
encoder = e.data.stats.outbound_stats[someValue].video_codec;
|
||||
logData({"encoder":encoder});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (out.split("Bitrate_in_kbps").length > 1) {
|
||||
for (var key in e.data.stats.inbound_stats[streamID]) {
|
||||
if (key.startsWith("RTCMediaStreamTrack_receiver") || key.startsWith("DEPRECATED_RTCMediaStreamTrack_receiver") ) {
|
||||
var bitrate = e.data.stats.inbound_stats[streamID][key][
|
||||
"Bitrate_in_kbps"
|
||||
];
|
||||
for (var key in e.data.stats.inbound_stats[streamID]){
|
||||
if (typeof e.data.stats.inbound_stats[streamID][key] == "object"){
|
||||
if ("Bitrate_in_kbps" in e.data.stats.inbound_stats[streamID][key]){
|
||||
var bitrate = e.data.stats.inbound_stats[streamID][key]["Bitrate_in_kbps"];
|
||||
updateData("bitrate", bitrate);
|
||||
|
||||
var buffer = e.data.stats.inbound_stats[streamID][key][
|
||||
"Buffer_Delay_in_ms"
|
||||
];
|
||||
}
|
||||
if ("Buffer_Delay_in_ms" in e.data.stats.inbound_stats[streamID][key]){
|
||||
var buffer = e.data.stats.inbound_stats[streamID][key]["Buffer_Delay_in_ms"];
|
||||
updateData("buffer", buffer);
|
||||
|
||||
}
|
||||
if ("packetLoss_in_percentage" in e.data.stats.inbound_stats[streamID][key]){
|
||||
var packetloss = e.data.stats.inbound_stats[streamID][key]["packetLoss_in_percentage"];
|
||||
if (packetloss != undefined) {
|
||||
packetloss = packetloss.toFixed(2);
|
||||
updateData("packetloss", packetloss);
|
||||
}
|
||||
}
|
||||
|
||||
if ("Resolution" in e.data.stats.inbound_stats[streamID][key]){
|
||||
var resolution = e.data.stats.inbound_stats[streamID][key]["Resolution"];
|
||||
|
||||
if (previousResolution != resolution) {
|
||||
@ -397,10 +396,9 @@
|
||||
logData({"resolution": resolution});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
59
comms.html
59
comms.html
@ -17,7 +17,8 @@
|
||||
<style>
|
||||
:root{
|
||||
--aspect-ratio: 1.7777777777;
|
||||
--chat-width: 450px;
|
||||
--chat-width: 400px;
|
||||
--chat-filler: 0px;
|
||||
}
|
||||
|
||||
body {
|
||||
@ -117,16 +118,19 @@
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
color: white;
|
||||
font-size: 150%;
|
||||
font-size: 250%;
|
||||
font-family: Verdana;
|
||||
line-height: 14px;
|
||||
line-height: 30px;
|
||||
z-index:20;
|
||||
}
|
||||
|
||||
#chatModule {
|
||||
bottom: 0;
|
||||
position: fixed;
|
||||
margin: 10px;
|
||||
margin-left:0;
|
||||
align-self: center;
|
||||
width: 400px;
|
||||
width: var(--chat-width);
|
||||
max-width: calc(100% - 40px);
|
||||
z-index:3;
|
||||
height: calc(100vh - 40px);
|
||||
@ -137,6 +141,7 @@
|
||||
border-radius: 10px;
|
||||
padding: 10px;
|
||||
transition: all .05s ease-in-out;
|
||||
max-height: 95vh;
|
||||
}
|
||||
#chatInput {
|
||||
display: inline-block;
|
||||
@ -207,7 +212,7 @@
|
||||
box-shadow: 1px 1px 3px #1b1b1b, -1px -1px 3px #1d1d1d;
|
||||
}
|
||||
#vdoninja {
|
||||
max-width: calc(100vw - 4px - var(--chat-width));
|
||||
max-width: calc(100vw - 54px - var(--chat-width) + var(--chat-filler));
|
||||
width: 100vw;
|
||||
height: calc(100vh - 117px);
|
||||
}
|
||||
@ -534,9 +539,11 @@
|
||||
}
|
||||
.groupContainer{
|
||||
display:inline-block;
|
||||
max-width: 50%;
|
||||
}
|
||||
.groupContainer>.group{
|
||||
transform: scale(calc( var(--aspect-ratio) / (16 / 9)), 1);
|
||||
max-width: 35vw;
|
||||
}
|
||||
.groupContainer:hover>.group{
|
||||
box-shadow: 0 0 6px #273a4e, 0 0px 6px #fffC;
|
||||
@ -887,6 +894,7 @@
|
||||
position: fixed;
|
||||
bottom: 10px;
|
||||
top: unset;
|
||||
font-size: 150%;
|
||||
}
|
||||
|
||||
</style>
|
||||
@ -990,12 +998,16 @@
|
||||
}
|
||||
|
||||
function toggleChat(){
|
||||
document.getElementById("chatModule").classList.toggle("fadeout");
|
||||
document.getElementById("chatModule").classList.toggle("hidden");
|
||||
document.getElementById("chatModuleButton").classList.toggle("hidden");
|
||||
if (document.getElementById("chatModule").classList.contains("fadeout")){
|
||||
|
||||
if (document.getElementById("chatModule").classList.contains("hidden")){
|
||||
document.documentElement.style.setProperty('--chat-width', "0px");
|
||||
document.documentElement.style.setProperty('--chat-filler', "33px");
|
||||
|
||||
} else {
|
||||
document.documentElement.style.setProperty('--chat-width', "450px");
|
||||
document.documentElement.style.setProperty('--chat-width', "400px");
|
||||
document.documentElement.style.setProperty('--chat-filler', "0px");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1056,11 +1068,18 @@
|
||||
} else if (urlParams.has('mobile')){
|
||||
mobile = true;
|
||||
}
|
||||
if (mobile){
|
||||
toggleChat();
|
||||
document.body.classList.add("mobile");
|
||||
|
||||
if (screen.height && screen.width && (screen.height*screen.width<400000)){
|
||||
mobile = true;
|
||||
}
|
||||
|
||||
if (mobile){
|
||||
//toggleChat();
|
||||
document.body.classList.add("mobile");
|
||||
//getById("chatModule").classList.add("hidden");
|
||||
}
|
||||
|
||||
|
||||
var password = false;
|
||||
if (urlParams.has('password') || urlParams.has('pass') || urlParams.has('pw') || urlParams.has('p')) {
|
||||
password = urlParams.get('password') || urlParams.get('pass') || urlParams.get('pw') || urlParams.get('p');
|
||||
@ -1715,13 +1734,19 @@
|
||||
}
|
||||
|
||||
if (mobile){
|
||||
additional2 += "&ad=1";
|
||||
additional2 += "&ad=1&chatbutton=1";
|
||||
} else {
|
||||
additional2 += "&chatbutton=0";
|
||||
}
|
||||
|
||||
var chatmsg = "Welcome to the Comms app. Select a group to participate in.";
|
||||
chatmsg = encodeURIComponent(chatmsg);
|
||||
|
||||
var iframesrc = "./index.html?groupmode&novice<b=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+"&chatmsg="+chatmsg;
|
||||
if (window.location.hostname == "comms.cam"){
|
||||
var iframesrc = "https://vdo.ninja/alpha/?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;
|
||||
}
|
||||
|
||||
|
||||
if (roomname!==false){
|
||||
@ -1734,7 +1759,9 @@
|
||||
drawGroup(savedSession.groups[i]);
|
||||
}
|
||||
|
||||
document.getElementById("chatModule").classList.remove("hidden");
|
||||
if (!mobile){
|
||||
document.getElementById("chatModule").classList.remove("hidden");
|
||||
}
|
||||
|
||||
iframe.onload = function(){
|
||||
iframe.contentWindow.postMessage({ groups: savedSession.groups }, "*");
|
||||
@ -1761,7 +1788,6 @@
|
||||
if (e.source != iframe.contentWindow){return} // reject messages send from other iframes
|
||||
|
||||
|
||||
console.log(e.data);
|
||||
if ("gotChat" in e.data){
|
||||
messageList.push(e.data.gotChat);
|
||||
messageList = messageList.slice(-100);
|
||||
@ -1878,9 +1904,6 @@
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
22
index.html
22
index.html
@ -57,7 +57,7 @@
|
||||
<meta property="twitter:image" content="./media/vdoNinja_logo_full.png" />
|
||||
<meta name="msapplication-TileColor" content="#da532c" />
|
||||
<meta name="theme-color" content="#ffffff" />
|
||||
<link rel="stylesheet" href="./main.css?ver=221" />
|
||||
<link rel="stylesheet" href="./main.css?ver=223" />
|
||||
<script type="text/javascript" crossorigin="anonymous" src="./thirdparty/adapter.js"></script>
|
||||
<style id="lightbox-animations" type="text/css"></style>
|
||||
<!-- <link rel="manifest" href="manifest.json" /> -->
|
||||
@ -83,7 +83,7 @@
|
||||
</span>
|
||||
<script type="text/javascript" crossorigin="anonymous" src="./thirdparty/CodecsHandler.js?ver=39"></script>
|
||||
<script type="text/javascript" crossorigin="anonymous" src="./thirdparty/aes.js"></script>
|
||||
<script type="text/javascript" crossorigin="anonymous" src="./webrtc.js?ver=529"></script>
|
||||
<script type="text/javascript" crossorigin="anonymous" src="./webrtc.js?ver=539"></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">
|
||||
@ -236,7 +236,7 @@
|
||||
<span title="Add to Calendar" onclick="toggle(document.getElementById('calendar'));" id="calendarButton">
|
||||
<i style="float: right; bottom: 0px; cursor: pointer; position: fixed; right: 33px; color: #d9e4eb; padding: 2px; margin: 2px 2px 0 0; font-size: 140%;" class="las la-calendar" aria-hidden="true"></i>
|
||||
</span>
|
||||
<div id="mainmenu" class="row" style="opacity: 0; align: center;">
|
||||
<div id="mainmenu" class="row" style="opacity: 0;">
|
||||
|
||||
<div id="container-1" title="Add Group Chat to OBS" alt="Add Group Chat to OBS" tabindex="2" role="button" aria-pressed="false" onkeyup="enterPressedClick(event,this);" class="column columnfade pointer rounded card" style=" overflow-y: auto;">
|
||||
|
||||
@ -547,7 +547,7 @@
|
||||
<i class="las la-cog" style="font-size: 170%; vertical-align: middle;" aria-hidden="true"></i>
|
||||
</span>
|
||||
<center>
|
||||
<span id="videoSettings2" style="margin: auto auto; display: none; vertical-aligh: middle; border: 3px solid #ccc; max-width: 500px; padding: 10px 10px 5px 10px; margin: 0px 0px 10px;">
|
||||
<span id="videoSettings2" style="margin: auto auto; display: none; border: 3px solid #ccc; max-width: 500px; padding: 10px 10px 5px 10px; margin: 0px 0px 10px;">
|
||||
<form id="webcamquality2">
|
||||
<input type="radio" id="fullhd2" name="resolution2" value="0" />
|
||||
<label for="fullhd">
|
||||
@ -1355,11 +1355,11 @@
|
||||
</button>
|
||||
|
||||
<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; updates on release. Dbl-click to reset." 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;"/>
|
||||
<input data-action-type="volume" type="range" min="0" max="200" value="100" title="Remotely change the volume of this guest; updates on release. Dbl-click to reset." oninput="remoteVolumeUI(this)" onchange="remoteVolume(this);" ondblclick="this.value=100;remoteVolume(this);remoteVolumeUI(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" 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>
|
||||
@ -1805,6 +1805,9 @@
|
||||
<button class='hidden drawActive' onclick="drawOnScreenObject.color(this);" data-color='green' style="background-color:green; margin: 0 0 0 4px; border-radius: 5px; padding: 3px 3px;">✏️</button>
|
||||
<button class='hidden drawActive' onclick="drawOnScreenObject.color(this);" data-color='black' style="background-color:black; margin: 0 0 0 4px; border-radius: 5px; padding: 3px 3px;">✏️</button>
|
||||
<button class='hidden drawActive' onclick="drawOnScreenObject.color(this);" data-color='white' style="background-color:white; margin: 0 0 0 4px; border-radius: 5px; padding: 3px 3px;">🎨</button>
|
||||
<br /><br />
|
||||
<button onclick="cycleStyleOptions();" id='toggleWaveformButton' title="Audio-only sources can be stylized in different ways" style="margin: 0 0 0 4px; border-radius: 5px; padding: 3px 3px;">Cycle between several audio-visualizations styles</button>
|
||||
|
||||
</span>
|
||||
</div>
|
||||
<nav id="context-menu" class="context-menu">
|
||||
@ -2112,6 +2115,7 @@
|
||||
<i class="las la-signal"></i>
|
||||
<i class="las la-fire-alt"></i>
|
||||
</div>
|
||||
<input type='range' id="volumeControlTemplate" class="volume-control hidden" min="0" max="100" value="100">
|
||||
<div id="batteryMeterTemplate" class="battery hidden" data-plugged="1">
|
||||
<div class="battery-level" style="height:100%;"></div>
|
||||
<div class="battery-charging">+</div>
|
||||
@ -2221,7 +2225,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 = "22.5";
|
||||
session.version = "22.6b";
|
||||
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
|
||||
@ -2292,11 +2296,11 @@
|
||||
// session.darkmode = false; // enable or disable the dark style theme as the default
|
||||
// session.defaultBackgroundImages = ["./media/bg_sample1.webp", "./media/bg_sample2.webp"]; // for &effects=5 (virtual backgrounds)
|
||||
</script>
|
||||
<script type="text/javascript" crossorigin="anonymous" id="lib-js" src="./lib.js?ver=511"></script>
|
||||
<script type="text/javascript" crossorigin="anonymous" id="lib-js" src="./lib.js?ver=530"></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=461"></script>
|
||||
<script type="text/javascript" crossorigin="anonymous" id="main-js" src="./main.js?ver=472"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
14
main.css
14
main.css
@ -803,6 +803,20 @@ hr {
|
||||
color:#00FF00;
|
||||
}
|
||||
|
||||
.volume-control {
|
||||
height: 44px;
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
bottom: 0px;
|
||||
font-size: 1.5em;
|
||||
z-index: 2;
|
||||
cursor: help;
|
||||
padding: 18px 5% !important;
|
||||
background: #555A;
|
||||
border-radius: 0 !important;
|
||||
margin: 0!important;
|
||||
}
|
||||
|
||||
.togglePreview{
|
||||
border-radius: 11px;
|
||||
background-color: #00000044;
|
||||
|
||||
24
main.js
24
main.js
@ -664,14 +664,23 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
|
||||
}
|
||||
|
||||
if (urlParams.has('sstype') || urlParams.has('screensharetype')) { // wha type of screen sharing is used; track replace, iframe, or secondary try
|
||||
session.screensharetype = urlParams.get('sstype') || urlParams.get('screensharetype');
|
||||
session.screensharetype = parseInt(session.screensharetype) || false;
|
||||
session.screenshareType = urlParams.get('sstype') || urlParams.get('screensharetype');
|
||||
session.screenshareType = parseInt(session.screenshareType) || false;
|
||||
}
|
||||
|
||||
if (urlParams.has('intro') || urlParams.has('ib')) {
|
||||
session.introButton = true;
|
||||
}
|
||||
|
||||
if (urlParams.has('volumecontrol') || urlParams.has('volumecontrols') || urlParams.has('vc')) {
|
||||
if (!(iOS || iPad)){
|
||||
session.volumeControl = true;
|
||||
}
|
||||
}
|
||||
if (urlParams.has('controlbarspace')){
|
||||
session.dedicatedControlBarSpace = true;
|
||||
}
|
||||
|
||||
if (urlParams.has('hidesolo') || urlParams.has('hs')){
|
||||
session.hidesololinks=true;
|
||||
}
|
||||
@ -1275,8 +1284,8 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (urlParams.has('labelsuggestion') || urlParams.has('ls')) {
|
||||
session.label = urlParams.get('labelsuggestion') || urlParams.get('ls') || null;
|
||||
} else if (urlParams.has('defaultlabel') || urlParams.has('labelsuggestion') || urlParams.has('ls')) {
|
||||
session.label = urlParams.get('defaultlabel') || urlParams.get('labelsuggestion') || urlParams.get('ls') || null;
|
||||
var updateURLAsNeed = true;
|
||||
window.focus();
|
||||
var label = await promptAlt(miscTranslations["enter-display-name"], true);
|
||||
@ -3060,6 +3069,10 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
|
||||
session.style = 1;
|
||||
}
|
||||
}
|
||||
//if (session.style){
|
||||
// getById("toggleWaveformButton").classList.remove("hidden");
|
||||
//}
|
||||
|
||||
if (urlParams.has('showall')){ // just an alternative; might be compoundable
|
||||
session.showall = true;
|
||||
}
|
||||
@ -4412,6 +4425,9 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
|
||||
setTimeout(function(UUID) {
|
||||
session.pcs[UUID].getStats().then(function(stats) {
|
||||
stats.forEach(stat => {
|
||||
|
||||
if (stat.id && stat.id.startsWith("DEPRECATED_")){return;}
|
||||
|
||||
if (stat.type == "outbound-rtp") {
|
||||
if (stat.kind == "video") {
|
||||
|
||||
|
||||
43
meet.html
43
meet.html
@ -117,9 +117,10 @@
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
color: white;
|
||||
font-size: 150%;
|
||||
font-size: 250%;
|
||||
font-family: Verdana;
|
||||
line-height: 14px;
|
||||
line-height: 30px;
|
||||
z-index:20;
|
||||
}
|
||||
#chatModule {
|
||||
bottom: 0;
|
||||
@ -137,6 +138,7 @@
|
||||
border-radius: 10px;
|
||||
padding: 10px;
|
||||
transition: all .05s ease-in-out;
|
||||
max-height: 95vh;
|
||||
}
|
||||
#chatInput {
|
||||
display: inline-block;
|
||||
@ -863,6 +865,7 @@
|
||||
position: fixed;
|
||||
bottom: 10px;
|
||||
top: unset;
|
||||
display:none;
|
||||
}
|
||||
|
||||
</style>
|
||||
@ -876,7 +879,7 @@
|
||||
<div class="xbutton" onclick="toggleChat();" title="Hide the chat window">x</div>
|
||||
<div id="chatBody" class="message">
|
||||
<div class="inMessage" data-translate='welcome-to-vdo-ninja-chat'>
|
||||
Welcome to VDO.Ninja! You can send text messages directly to connected peers from here.
|
||||
Welcome to the Meet app! You can send text messages directly to connected peers from here.
|
||||
</div>
|
||||
</div>
|
||||
<div id="chatSendBar">
|
||||
@ -1032,10 +1035,14 @@
|
||||
} else if (urlParams.has('mobile')){
|
||||
mobile = true;
|
||||
}
|
||||
if (screen.height && screen.width && (screen.height*screen.width<400000)){
|
||||
mobile = true;
|
||||
}
|
||||
|
||||
if (mobile){
|
||||
toggleChat();
|
||||
document.body.classList.add("mobile");
|
||||
}
|
||||
}
|
||||
|
||||
var password = false;
|
||||
if (urlParams.has('password') || urlParams.has('pass') || urlParams.has('pw') || urlParams.has('p')) {
|
||||
@ -1697,15 +1704,17 @@
|
||||
if (mobile){
|
||||
additional2 += "&ad=1";
|
||||
}
|
||||
|
||||
var iframesrc = "./index.html?novideo&nopreview&novice<b=350&transparent&hideheader&margin&rounded&hidetranslate&cleandirector&chatbutton=0&vd=0&webcam&nvb&showlabel=skype&style=2&room="+roomname+additional+additional2+"&b64css="+injectCSS+streamID+label;
|
||||
|
||||
if (mobile){
|
||||
var iframesrc = "./index.html?novice<b=350&minipreview&transparent&hideheader&margin&rounded&hidetranslate&cleandirector&chatbutton&vd=0&webcam&nvb&sstype=3&ssb&showlabel=skype&style=2&room="+roomname+additional+additional2+"&b64css="+injectCSS+streamID+label;
|
||||
} else {
|
||||
var iframesrc = "./index.html?novice<b=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;
|
||||
}
|
||||
|
||||
if (roomname!==false){
|
||||
setStorage("savedRoom_comms", {roomname:roomname,password:password}, 9999);
|
||||
}
|
||||
|
||||
document.title = "Mixer: "+roomname;
|
||||
document.title = "Room: "+roomname;
|
||||
|
||||
//for (var i in savedSession.groups){
|
||||
// drawGroup(savedSession.groups[i]);
|
||||
@ -1731,6 +1740,9 @@
|
||||
var eventer = window[eventMethod];
|
||||
var messageEvent = eventMethod === "attachEvent" ? "onmessage" : "message";
|
||||
var setupYet = false;
|
||||
var showingVideoButton = false;
|
||||
|
||||
/// If you have a routing system setup
|
||||
/// If you have a routing system setup, you could have just one global listener for all iframes instead.
|
||||
|
||||
eventer(messageEvent, function (e) {
|
||||
@ -1746,6 +1758,12 @@
|
||||
}
|
||||
|
||||
if (e.data.action && "action" in e.data){
|
||||
if (e.data.action === "local-camera-event"){
|
||||
if (!showingVideoButton){
|
||||
showingVideoButton = true;
|
||||
iframe.contentWindow.postMessage({"function":"eval", "value":'getById("mutevideobutton").style.setProperty("display", "block", "important");'}, '*');
|
||||
}
|
||||
}
|
||||
|
||||
if ("joining-room" == e.data.action){
|
||||
if (!setupYet){
|
||||
@ -1923,6 +1941,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
function changeAspectRatio(ar, button){
|
||||
document.querySelectorAll(".aspectbutton").forEach(ele=>{
|
||||
if (ele == button){return;}
|
||||
ele.checked = false;
|
||||
ele.value = false;
|
||||
});
|
||||
aspectRatio = ar;
|
||||
document.documentElement.style.setProperty('--aspect-ratio', ar);
|
||||
}
|
||||
//let modal = document.querySelector("#modal");
|
||||
document.querySelectorAll(".close-btn").forEach(ele2=>{
|
||||
ele2.onclick = function(){
|
||||
|
||||
@ -99,10 +99,6 @@
|
||||
return raw ? parseInt(raw[2], 10) : false;
|
||||
}
|
||||
|
||||
if (!getChromeVersion()){
|
||||
alert("This speedtest is optimized for Chromium-based browsers; graphs will not work for Firefox or Safari browsers.");
|
||||
}
|
||||
|
||||
function next1(){
|
||||
document.getElementById("page1").classList.add("hidden");
|
||||
document.getElementById("page2").classList.remove("hidden");
|
||||
|
||||
@ -99,9 +99,9 @@
|
||||
return raw ? parseInt(raw[2], 10) : false;
|
||||
}
|
||||
|
||||
if (!getChromeVersion()){
|
||||
alert("This speedtest is optimized for Chromium-based browsers; graphs will not work for Firefox or Safari browsers.");
|
||||
}
|
||||
//if (!getChromeVersion()){
|
||||
// alert("This speedtest is optimized for Chromium-based browsers; graphs will not work for Firefox or Safari browsers.");
|
||||
//}
|
||||
|
||||
(function (w) {
|
||||
w.URLSearchParams =
|
||||
@ -357,14 +357,22 @@
|
||||
var previousResolution;
|
||||
|
||||
eventer(messageEvent, function (e) {
|
||||
//console.log(e.data);
|
||||
if ("action" in e.data) {
|
||||
|
||||
|
||||
if (e.data.action == "view-stats-updated"){
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.data.action == "setVideoBitrate"){
|
||||
logData("Target Video Bitrate",e.data.value);
|
||||
}
|
||||
|
||||
if (e.data.action == "available-speedtest-servers"){
|
||||
console.warn("Speedtest server list loaded");
|
||||
//console.warn("Speedtest server list loaded");
|
||||
updateTurnlist(e.data.value);
|
||||
} else {
|
||||
logData(e.data.action, e.data.value);
|
||||
//logData(e.data.action, e.data.value);
|
||||
}
|
||||
|
||||
if (e.data.action == "new-view-connection") {
|
||||
@ -397,54 +405,60 @@
|
||||
if ("stats" in e.data) {
|
||||
var out = "";
|
||||
|
||||
for (var streamID in e.data.stats.inbound_stats) {
|
||||
out += printValues(e.data.stats.inbound_stats[streamID]);
|
||||
for (var someValue in e.data.stats.inbound_stats) {
|
||||
out += printValues(e.data.stats.inbound_stats[someValue]);
|
||||
}
|
||||
|
||||
for (var streamID in e.data.stats.outbound_stats) {
|
||||
if (e.data.stats.outbound_stats[streamID].quality_limitation_reason){
|
||||
if (quality_reason != e.data.stats.outbound_stats[streamID].quality_limitation_reason) {
|
||||
quality_reason = e.data.stats.outbound_stats[streamID].quality_limitation_reason;
|
||||
logData("Quality Limitation Reason:", quality_reason);
|
||||
for (var someValue in e.data.stats.outbound_stats) {
|
||||
if (e.data.stats.outbound_stats[someValue].quality_limitation_reason){
|
||||
if (quality_reason != e.data.stats.outbound_stats[someValue].quality_limitation_reason) {
|
||||
quality_reason = e.data.stats.outbound_stats[someValue].quality_limitation_reason;
|
||||
logData("Quality Limitation Reason", quality_reason);
|
||||
}
|
||||
}
|
||||
|
||||
if (e.data.stats.outbound_stats[streamID].encoder){
|
||||
if (encoder != e.data.stats.outbound_stats[streamID].encoder) {
|
||||
encoder = e.data.stats.outbound_stats[streamID].encoder;
|
||||
logData("Encoder used:", encoder);
|
||||
if (e.data.stats.outbound_stats[someValue].encoder){
|
||||
if (encoder != e.data.stats.outbound_stats[someValue].encoder) {
|
||||
encoder = e.data.stats.outbound_stats[someValue].encoder;
|
||||
logData("Encoder used", encoder);
|
||||
}
|
||||
} else if (e.data.stats.outbound_stats[someValue].video_codec){
|
||||
if (encoder != e.data.stats.outbound_stats[someValue].video_codec) {
|
||||
encoder = e.data.stats.outbound_stats[someValue].video_codec;
|
||||
logData("Encoder used", encoder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (out.split("Bitrate_in_kbps").length > 1) {
|
||||
for (var key in e.data.stats.inbound_stats[streamID]) {
|
||||
if (key.startsWith("RTCMediaStreamTrack_receiver") || key.startsWith("DEPRECATED_RTCMediaStreamTrack_receiver")) {
|
||||
var bitrate = e.data.stats.inbound_stats[streamID][key][
|
||||
"Bitrate_in_kbps"
|
||||
];
|
||||
for (var key in e.data.stats.inbound_stats[streamID]){
|
||||
if (typeof e.data.stats.inbound_stats[streamID][key] == "object"){
|
||||
//console.error(e.data.stats.inbound_stats[streamID][key]);
|
||||
if ("Bitrate_in_kbps" in e.data.stats.inbound_stats[streamID][key]){
|
||||
var bitrate = e.data.stats.inbound_stats[streamID][key]["Bitrate_in_kbps"];
|
||||
updateData("bitrate", bitrate);
|
||||
}
|
||||
|
||||
var buffer = e.data.stats.inbound_stats[streamID][key][
|
||||
"Buffer_Delay_in_ms"
|
||||
];
|
||||
|
||||
if ("Buffer_Delay_in_ms" in e.data.stats.inbound_stats[streamID][key]){
|
||||
var buffer = e.data.stats.inbound_stats[streamID][key]["Buffer_Delay_in_ms"];
|
||||
updateData("buffer", buffer);
|
||||
|
||||
}
|
||||
if ("packetLoss_in_percentage" in e.data.stats.inbound_stats[streamID][key]){
|
||||
var packetloss = e.data.stats.inbound_stats[streamID][key]["packetLoss_in_percentage"];
|
||||
if (packetloss != undefined) {
|
||||
packetloss = packetloss.toFixed(2);
|
||||
updateData("packetloss", packetloss);
|
||||
}
|
||||
}
|
||||
|
||||
if ("Resolution" in e.data.stats.inbound_stats[streamID][key]){
|
||||
var resolution = e.data.stats.inbound_stats[streamID][key]["Resolution"];
|
||||
|
||||
if (previousResolution != resolution) {
|
||||
previousResolution = resolution;
|
||||
logData("Resolution", resolution);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (recordResults){
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user