Merge pull request #3 from steveseguin/lindenkron-Screenshare-Buttons-fixed

Lindenkron screenshare buttons fixed
This commit is contained in:
lindenkron 2023-04-09 21:17:16 +02:00 committed by GitHub
commit a2916ed1ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6627 additions and 25 deletions

View File

@ -56,7 +56,7 @@
<meta property="twitter:image" content="./media/vdoNinja_logo_full.png" /> <meta property="twitter:image" content="./media/vdoNinja_logo_full.png" />
<meta name="msapplication-TileColor" content="#da532c" /> <meta name="msapplication-TileColor" content="#da532c" />
<meta name="theme-color" content="#ffffff" /> <meta name="theme-color" content="#ffffff" />
<link rel="stylesheet" href="./main.css?ver=279" /> <link rel="stylesheet" href="./main.css?ver=283" />
<script type="text/javascript" crossorigin="anonymous" src="./thirdparty/adapter.js"></script> <script type="text/javascript" crossorigin="anonymous" src="./thirdparty/adapter.js"></script>
<style id="lightbox-animations" type="text/css"></style> <style id="lightbox-animations" type="text/css"></style>
<!-- <link rel="manifest" href="manifest.json" /> --> <!-- <link rel="manifest" href="manifest.json" /> -->
@ -1640,7 +1640,7 @@
<i class="las la-microphone-slash"></i> <i class="las la-microphone-slash"></i>
<span data-translate="mute-scene">mute in scene</span> <span data-translate="mute-scene">mute in scene</span>
</button> </button>
<button data-action-type="solo-video" class="" title="Solo this video everywhere. (Hold CTRL/CMD to just make video larger)" onclick="requestInfocus(this, event);"> <button data-action-type="solo-video" class="btn-HL-yellow" title="Solo this video everywhere. (Hold CTRL/CMD to just make video larger)" onclick="requestInfocus(this, event);">
<i class="las la-user"></i> <i class="las la-user"></i>
<span data-translate="solo-video-director">Highlight</span> <span data-translate="solo-video-director">Highlight</span>
</button> </button>
@ -2494,11 +2494,11 @@
// session.hidehome = true; // If used, 'hide home' will make the landing page inaccessible, along with hiding a few go-home elements. // session.hidehome = true; // If used, 'hide home' will make the landing page inaccessible, along with hiding a few go-home elements.
// session.record = false; // uncomment to block users from being able to record via vdo.ninja's built in recording function // session.record = false; // uncomment to block users from being able to record via vdo.ninja's built in recording function
</script> </script>
<script type="text/javascript" crossorigin="anonymous" id="lib-js" src="./lib.js?ver=715"></script> <script type="text/javascript" crossorigin="anonymous" id="lib-js" src="./lib.js?ver=722"></script>
<!-- <!--
// If you wish to change branding, blank offers a good clean start. // 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" id="main-js" src="./main.js" data-translation="blank"></script>
--> -->
<script type="text/javascript" crossorigin="anonymous" id="main-js" src="./main.js?ver=577"></script> <script type="text/javascript" crossorigin="anonymous" id="main-js" src="./main.js?ver=582"></script>
</body> </body>
</html> </html>

52
lib.js
View File

@ -8841,6 +8841,7 @@ function playoutdelay(UUID){ // applies a delay to all videos
} }
}; };
function printViewStats(menu, UUID) { // Stats for viewing a remote video function printViewStats(menu, UUID) { // Stats for viewing a remote video
if (!session.rpcs[UUID]){ if (!session.rpcs[UUID]){
menu.innerHTML = "<br /><br /><br />Remote Publisher Disconnected"; menu.innerHTML = "<br /><br /><br />Remote Publisher Disconnected";
@ -8852,6 +8853,12 @@ function printViewStats(menu, UUID) { // Stats for viewing a remote video
var scrollLeft = menu.scrollLeft; var scrollLeft = menu.scrollLeft;
var scrollTop = menu.scrollTop; var scrollTop = menu.scrollTop;
menu.innerHTML = "StreamID: <b>" + streamID + "</b><br />"; menu.innerHTML = "StreamID: <b>" + streamID + "</b><br />";
//// doesn't work on viewer side.
//if (session.rpcs && session.rpcs[UUID] && session.rpcs[UUID] && session.rpcs[UUID].restartIce){ // only show if available
// menu.innerHTML += "<button onclick='session.rpcs[\""+UUID+"\"].restartIce();'>Restart connection</button>";
//}
menu.innerHTML += printValues(statsObj); menu.innerHTML += printValues(statsObj);
menu.scrollTop = scrollTop; menu.scrollTop = scrollTop;
menu.scrollLeft = scrollLeft; menu.scrollLeft = scrollLeft;
@ -9429,7 +9436,7 @@ function printMyStats(menu) { // see: setupStatsMenu
} }
} catch(e){errorlog(e);} } catch(e){errorlog(e);}
function printViewValues(obj) { function printViewValues(obj, UUID=false) {
if (!(document.getElementById("menuStatsBox"))){ if (!(document.getElementById("menuStatsBox"))){
return; return;
@ -9451,6 +9458,11 @@ function printMyStats(menu) { // see: setupStatsMenu
menu.innerHTML += "<hr />"; menu.innerHTML += "<hr />";
} }
}); });
if (session.pcs[UUID] && session.pcs[UUID].restartIce){ // only show if available
menu.innerHTML += "<button onclick='session.pcs[\""+UUID+"\"].restartIce();'>Restart connection</button>";
}
keys.forEach(key=>{ keys.forEach(key=>{
if (typeof obj[key] !== "object") { if (typeof obj[key] !== "object") {
if (key.startsWith("_")){return;} if (key.startsWith("_")){return;}
@ -9511,7 +9523,7 @@ function printMyStats(menu) { // see: setupStatsMenu
menu.innerHTML += "<hr>"; menu.innerHTML += "<hr>";
} }
for (var uuid in session.pcs) { for (var uuid in session.pcs) {
printViewValues(session.pcs[uuid].stats); printViewValues(session.pcs[uuid].stats, uuid);
menu.innerHTML += "<hr>"; menu.innerHTML += "<hr>";
} }
if ((iOS) || (iPad)){ if ((iOS) || (iPad)){
@ -10391,7 +10403,9 @@ function toggleMute(apply = false, event=false) { // TODO: I need to have this b
//} //}
} }
postMessageIframe(document.getElementById("screensharesource"), {"mic":!session.muted}); try {
postMessageIframe(document.getElementById("screensharesource"), {"mic":!session.muted});
} catch(e){}
if (!apply) { // only if they are changing states do we bother to spam. if (!apply) { // only if they are changing states do we bother to spam.
data = {}; data = {};
@ -10404,7 +10418,7 @@ function toggleMute(apply = false, event=false) { // TODO: I need to have this b
} }
function postMessageIframe(iFrameEle, message){ // iframes seem to only have the contentWindow work on the last placed iframe object, so this checks the dom first. function postMessageIframe(iFrameEle, message){ // iframes seem to only have the contentWindow work on the last placed iframe object, so this checks the dom first.
if (iFrameEle){ if (iFrameEle && (iFrameEle.nodeName == "IFRAME")){
try{ try{
if (iFrameEle.id && document.getElementById(iFrameEle.id)){ if (iFrameEle.id && document.getElementById(iFrameEle.id)){
document.getElementById(iFrameEle.id).contentWindow.postMessage(message, '*'); document.getElementById(iFrameEle.id).contentWindow.postMessage(message, '*');
@ -19168,13 +19182,14 @@ async function toggleScreenShare(reload = false) { ////////////////////////////
} }
if (screenShareAudioTrack){ if (screenShareAudioTrack){
if (session.videoElement && session.videoElement.srcObject){
session.videoElement.srcObject.getAudioTracks().forEach(function(track) { // previous video track; saving it. Must remove the track at some point. session.videoElement.srcObject.getAudioTracks().forEach(function(track) { // previous video track; saving it. Must remove the track at some point.
if (screenShareAudioTrack.id == track.id) { // since there are more than one audio track, lets see if we can remove JUST the audio track for the screen share. if (screenShareAudioTrack.id == track.id) { // since there are more than one audio track, lets see if we can remove JUST the audio track for the screen share.
session.videoElement.srcObject.removeTrack(track); session.videoElement.srcObject.removeTrack(track);
track.stop(); track.stop();
} }
}); });
}
if (session.streamSrcClone){ // if (session.streamSrcClone){ //
session.streamSrcClone.getAudioTracks().forEach(function(track) { session.streamSrcClone.getAudioTracks().forEach(function(track) {
@ -19184,13 +19199,14 @@ async function toggleScreenShare(reload = false) { ////////////////////////////
} }
}); });
} }
if (session.streamSrc){
session.streamSrc.getAudioTracks().forEach(function(track) { // previous video track; saving it. Must remove the track at some point. session.streamSrc.getAudioTracks().forEach(function(track) { // previous video track; saving it. Must remove the track at some point.
if (screenShareAudioTrack.id == track.id) { // since there are more than one audio track, lets see if we can remove JUST the audio track for the screen share. if (screenShareAudioTrack.id == track.id) { // since there are more than one audio track, lets see if we can remove JUST the audio track for the screen share.
session.streamSrc.removeTrack(track); session.streamSrc.removeTrack(track);
track.stop(); track.stop();
} }
}); });
}
session.videoElement.srcObject = outboundAudioPipeline(); // updateREnderOoutput is just for video if videoElement is already activated. session.videoElement.srcObject = outboundAudioPipeline(); // updateREnderOoutput is just for video if videoElement is already activated.
screenShareAudioTrack=null; screenShareAudioTrack=null;

File diff suppressed because it is too large Load Diff

1
lineawesome/css/line-awesome.min.css vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -3952,6 +3952,9 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
} }
} }
if (urlParams.has('miconlyoption') || urlParams.has('moo')){
session.optionalMicOnly = true;
}
if (urlParams.has('hidescreenshare') || urlParams.has('hidess') || urlParams.has('sshide') || urlParams.has('screensharehide')) { // this way I don't need to remember what it's called. I can just guess. :D if (urlParams.has('hidescreenshare') || urlParams.has('hidess') || urlParams.has('sshide') || urlParams.has('screensharehide')) { // this way I don't need to remember what it's called. I can just guess. :D
session.screenShareElementHidden = true; session.screenShareElementHidden = true;
@ -4064,13 +4067,13 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
} }
} else if (session.audioDevice === 0) { } else if (session.audioDevice === 0) {
miniTranslate(getById("add_camera"), "join-room-with-camera", "Join Room with Camera"); miniTranslate(getById("add_camera"), "join-room-with-camera", "Join Room with Camera");
} else { } else if (session.optionalMicOnly){
miniTranslate(getById("add_camera"), "join-room-with-video", "Join Room with Video"); miniTranslate(getById("add_camera"), "join-room-with-video", "Join Room with Video");
miniTranslate(getById("add_microphone"), "join-room-with-mic-only", "Join Room with just Microphone"); miniTranslate(getById("add_microphone"), "join-room-with-mic-only", "Join Room with just Microphone");
getById("container-3a").classList.remove("hidden"); getById("container-3a").classList.remove("hidden");
} else{
miniTranslate(getById("add_camera"), "join-room-with-camera", "Join Room with Camera");
} }
miniTranslate(getById("add_screen"), "share-screen-with-room", "Screenshare with Room"); miniTranslate(getById("add_screen"), "share-screen-with-room", "Screenshare with Room");
} else { } else {