MeshMessenger improvements.

This commit is contained in:
Ylian Saint-Hilaire 2021-01-05 03:10:45 -08:00
parent 4990b09226
commit b39b733e22
4 changed files with 26 additions and 6 deletions

View File

@ -8089,6 +8089,12 @@
"account-check.html->2->5->1" "account-check.html->2->5->1"
] ]
}, },
{
"en": "Click here to view.",
"xloc": [
"messenger.handlebars->remoteVideo->remoteClickToView"
]
},
{ {
"cs": "Klikněte na OK a bude vám zaslán ověřovací e-mail na:", "cs": "Klikněte na OK a bude vám zaslán ověřovací e-mail na:",
"de": "Auf OK klicken, um eine Bestätigungsmail an folgende Adresse zu senden:", "de": "Auf OK klicken, um eine Bestätigungsmail an folgende Adresse zu senden:",

View File

@ -391,7 +391,7 @@
.devList5 { .devList5 {
padding-left: 12px; padding-left: 12px;
padding-top: 3px; padding-top: 3px;
color: gray color: #444
} }
.deskButton { .deskButton {

View File

@ -3243,7 +3243,7 @@
var xuserid = args.gotouser; var xuserid = args.gotouser;
if (args.gotouser.indexOf('/') < 0) { xuserid = 'user/' + domain + '/' + args.gotouser; } if (args.gotouser.indexOf('/') < 0) { xuserid = 'user/' + domain + '/' + args.gotouser; }
if ((users == null) || (users[xuserid] == null)) return; // This user is not loaded yet if ((users == null) || (users[xuserid] == null)) return; // This user is not loaded yet
gotoUser(xuserid); gotoUser(encodeURIComponentEx(xuserid));
go(xviewmode); go(xviewmode);
goBackStack.push(4); goBackStack.push(4);
} else if (args.gotougrp != null) { } else if (args.gotougrp != null) {
@ -12923,7 +12923,7 @@
var ruser = null; var ruser = null;
if (users != null) { ruser = users[rec.userids[0]]; } if (users != null) { ruser = users[rec.userids[0]]; }
if (ruser != null) { if (ruser != null) {
sessionName += ' - <a href=# onclick=\'gotoUser("' + rec.userids[0] + '")\'>' + EscapeHtml(ruser.name) + '</a>'; sessionName += ' - <a href=# onclick=\'gotoUser("' + encodeURIComponentEx(rec.userids[0]) + '")\'>' + EscapeHtml(ruser.name) + '</a>';
} else { } else {
sessionName += ' - ' + EscapeHtml(rec.userids[0].split('/')[2]); sessionName += ' - ' + EscapeHtml(rec.userids[0].split('/')[2]);
} }
@ -13641,7 +13641,7 @@
if ((xxcurrentView == 11) && (desktop != null) && (desktop.m.recordedData != null)) { deskRecordSession(); } if ((xxcurrentView == 11) && (desktop != null) && (desktop.m.recordedData != null)) { deskRecordSession(); }
// If we are trying to go to "My Users" and we are not a user manager, move to recordings // If we are trying to go to "My Users" and we are not a user manager, move to recordings
if (((x == 4) && ((userinfo.siteadmin & 2) == 0)) || ((features & 4) != 0)) { x = 52; } if (((x == 4) && (userinfo != null) && ((userinfo.siteadmin & 2) == 0)) || ((features & 4) != 0)) { x = 52; }
// Stop the list graph if active // Stop the list graph if active
if (xxcurrentView == 17) deviceDetailsStatsClear(); if (xxcurrentView == 17) deviceDetailsStatsClear();

View File

@ -47,7 +47,8 @@
</div> </div>
<div id="remoteVideo" style="position:absolute;right:24px;top:45px;width:320px;height:calc(240px + 30px);background-color:gray;border-radius:12px 12px 12px 12px;box-shadow:3px 3px 10px gray;display:none"> <div id="remoteVideo" style="position:absolute;right:24px;top:45px;width:320px;height:calc(240px + 30px);background-color:gray;border-radius:12px 12px 12px 12px;box-shadow:3px 3px 10px gray;display:none">
<div style="position:absolute;right:0;left:0;top:2.5px;text-align:center">Remote</div> <div style="position:absolute;right:0;left:0;top:2.5px;text-align:center">Remote</div>
<video id="remoteVideoCanvas" autoplay style="position:absolute;top:20px;left:0;width:100%;height:calc(100% - 30px);background-color:black"></video> <video id="remoteVideoCanvas" autoplay style="position:absolute;top:20px;left:0;width:100%;height:calc(100% - 30px);background-color:black" onclick="remotePlay(event)"></video>
<div id="remoteClickToView" style="position:absolute;top:20px;left:0;width:100%;height:calc(100% - 30px);color:white;text-align:center;padding-top:20px;display:none" onclick="remotePlay(event)">Click here to view.</div>
</div> </div>
<div id="localVideo" style="position:absolute;right:24px;top:320px;width:160px;height:calc(120px + 30px);background-color:gray;border-radius:12px 12px 12px 12px;box-shadow:3px 3px 10px gray;display:none"> <div id="localVideo" style="position:absolute;right:24px;top:320px;width:160px;height:calc(120px + 30px);background-color:gray;border-radius:12px 12px 12px 12px;box-shadow:3px 3px 10px gray;display:none">
<div style="position:absolute;right:0;left:0;top:2.5px;text-align:center">Local</div> <div style="position:absolute;right:0;left:0;top:2.5px;text-align:center">Local</div>
@ -272,9 +273,20 @@
} }
webrtc.ontrack = function (event) { webrtc.ontrack = function (event) {
//console.log('ontrack', id); //console.log('ontrack', id);
QV('remoteClickToView', false);
var video = Q('remoteVideoCanvas'); var video = Q('remoteVideoCanvas');
video.srcObject = remoteStream = event.streams[0]; video.srcObject = remoteStream = event.streams[0];
video.onloadedmetadata = function (e) { video.play(); }; video.onloadedmetadata = function (e) {
var promise = video.play();
if (promise !== undefined) {
promise.then(function() {
// Video start ok
}).catch(function(err) {
// Video start error, display a play button
QV('remoteClickToView', true);
})
}
};
displayRemoteVideo(true); displayRemoteVideo(true);
} }
//webrtc.onremovetrack = function (event) { console.log('onremovetrack'); } //webrtc.onremovetrack = function (event) { console.log('onremovetrack'); }
@ -293,6 +305,8 @@
return webrtc; return webrtc;
} }
function remotePlay() { QV('remoteClickToView', false); Q('remoteVideoCanvas').play(); }
function webRtcHandleOffer(id, description) { function webRtcHandleOffer(id, description) {
//console.log('webRtcHandleOffer', description.sdp.length); //console.log('webRtcHandleOffer', description.sdp.length);
var webrtc = webrtcSessions[id]; var webrtc = webrtcSessions[id];