Commit 16e88d0d by Иван Кубота

connection message, connect buttons

parent f8bd91c5
...@@ -229,6 +229,22 @@ Screen.Conference = function() { ...@@ -229,6 +229,22 @@ Screen.Conference = function() {
window.instances.push(RTCinstance); window.instances.push(RTCinstance);
RTCinstance.mUiRemoteVideoParent = currentCameraID ? null : remoteVideoEl; RTCinstance.mUiRemoteVideoParent = currentCameraID ? null : remoteVideoEl;
var slots = {
RemoveUser: {1: 0, 2: 1},
OfficeUser: {1: 2, 2: 3}
};
RTCinstance.connectMessage = ()=>{
var slot = slots[store.get( 'userRole' )][store.get( 'guestPosition' )];
debugger
return {
"roomSlot": slot,
"webCam": cameras[currentCameraID%3]
}
};
var selfieSegmentation = new SelfieSegmentation( { var selfieSegmentation = new SelfieSegmentation( {
locateFile: ( file ) => { locateFile: ( file ) => {
return `https://cdn.jsdelivr.net/npm/@mediapipe/selfie_segmentation/${file}`; return `https://cdn.jsdelivr.net/npm/@mediapipe/selfie_segmentation/${file}`;
...@@ -294,6 +310,25 @@ Screen.Conference = function() { ...@@ -294,6 +310,25 @@ Screen.Conference = function() {
generateCameraUI()*/ generateCameraUI()*/
), ),
D.div({cls: ['bottom-buttons', {
hidden: Store.NOT(store.val('callScreenCamerasTune'))
}]},
D.h('button', {
cls: ['button primary', {disabled: Store.NOT(store.val('guestPosition'))}],
onclick: ()=>{
store.set('connection', true)
}
}, 'Ready to connect'),
D.h('button', {
cls: ['button orange', {hidden: /*isConnected*/false}],
onclick: ()=>{
store.set('connection', false);
Screen.show( 'Main', true );
}}, 'Exit to main menu')
),
window.addACameraBtn = D.h('button', {cls: ['button primary hidden', {hidden: Store.OR(isConnected, tooMuchUsers)}], window.addACameraBtn = D.h('button', {cls: ['button primary hidden', {hidden: Store.OR(isConnected, tooMuchUsers)}],
onclick: ()=> { onclick: ()=> {
usersBlock.appendChild(generateCameraUI()) usersBlock.appendChild(generateCameraUI())
......
...@@ -19,6 +19,7 @@ export class VideoInputApp { ...@@ -19,6 +19,7 @@ export class VideoInputApp {
private mIsRunning = false; private mIsRunning = false;
public ___id: string; public ___id: string;
public connectMessage: any;
public constructor() { public constructor() {
this.mNetConfig.IceServers = [ this.mNetConfig.IceServers = [
...@@ -217,10 +218,7 @@ export class VideoInputApp { ...@@ -217,10 +218,7 @@ export class VideoInputApp {
let messageArgs = args as awrtc.MessageEventArgs; let messageArgs = args as awrtc.MessageEventArgs;
this.mCall.Send(JSON.stringify({ this.mCall.Send(JSON.stringify(this.connectMessage()), messageArgs.Reliable, messageArgs.ConnectionId);
userId: store.get('userRole'+this.___id),
webCam: store.get('webcam'+this.___id)
}), messageArgs.Reliable, messageArgs.ConnectionId);
/* this.mCall.SendData(JSON.stringify({ /* this.mCall.SendData(JSON.stringify({
userId: store.get('userRole'+this.___id), userId: store.get('userRole'+this.___id),
webCam: store.get('webcam'+this.___id) webCam: store.get('webcam'+this.___id)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment