From 55feb713b9f3e11bd99370911216757b9e0cfbf6 Mon Sep 17 00:00:00 2001 From: Steve Seguin Date: Fri, 10 Apr 2020 00:25:55 -0400 Subject: [PATCH] bugs and tweaks Fixed a regression relating to STUN. In my rewrote of the webrtc code, and frantic attempts to fix other bugs, I introduced one that caused STUN to only *partially* complete. For a few users, that was enough to break it. I also had some users complaining about iOS resolutions not being high. While you can manually increase this, I decided to instead set the default res to 1280x720. up from 640x360. I'm trying to find a good balance here. If battery life becomes an issue, I may also need to force the codec to h264, instead of allowing VP8. =/ --- index.html | 74 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 45 insertions(+), 29 deletions(-) diff --git a/index.html b/index.html index 8e0df8b..f367c6e 100644 --- a/index.html +++ b/index.html @@ -452,7 +452,7 @@ video { - + @@ -627,6 +625,24 @@ function updateURL(param) { } var session = Ooblex.Media; session.streamID = session.generateStreamID(); +(function (w) { + + w.URLSearchParams = w.URLSearchParams || function (searchString) { + var self = this; + self.searchString = searchString; + self.get = function (name) { + var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(self.searchString); + if (results == null) { + return null; + } + else { + return decodeURI(results[1]) || 0; + } + }; + } + +})(window) + var urlParams = new URLSearchParams(window.location.search); if (urlParams.has('permaid')){ var permaid = urlParams.get('permaid'); @@ -1026,32 +1042,32 @@ function handleError(error) { function getUserMediaVideoParams(resolutionFallbackLevel, isSafariBrowser) { switch (resolutionFallbackLevel) { - case 0: - if (isSafariBrowser) { - return { - width: { min: 640 }, - height: { min: 360 } - }; - } - else { - return { - width: { min: 720, ideal: 1920, max: 1920 }, - height: { min: 720, ideal: 1080, max: 1920 } - }; - } - case 1: - if (isSafariBrowser) { - return { - width: { min: 720, ideal: 1280, max: 1280 }, - height: { min: 720, ideal: 720, max: 1280 } - }; - } - else { - return { - width: { min: 720, ideal: 1280, max: 1280 }, - height: { min: 720, ideal: 720, max: 1280 } - }; - } + case 0: + if (isSafariBrowser) { + return { + width: { min: 360, ideal: 1280, max: 1920 }, + height: { min: 360, ideal: 720, max: 1080 } + }; + } + else { + return { + width: { min: 720, ideal: 1920, max: 1920 }, + height: { min: 720, ideal: 1080, max: 1920 } + }; + } + case 1: + if (isSafariBrowser) { + return { + width: { min: 640 }, + height: { min: 360 } + }; + } + else { + return { + width: { min: 720, ideal: 1280, max: 1280 }, + height: { min: 720, ideal: 720, max: 1280 } + }; + } case 2: if (isSafariBrowser) { return {