Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
awrtc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Кубота
awrtc
Commits
40660135
Commit
40660135
authored
Sep 19, 2021
by
Иван Кубота
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change format of message. Send message to every esteblished connection
parent
e5b61a04
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
14 deletions
+15
-14
app.js
build/app.js
+4
-4
videoinputapp.ts
src/apps/videoinputapp.ts
+11
-10
No files found.
build/app.js
View file @
40660135
...
@@ -294,14 +294,14 @@ var RTC = function(parent, canvas, devname, id) {
...
@@ -294,14 +294,14 @@ var RTC = function(parent, canvas, devname, id) {
callApp
.
___id
=
id
;
callApp
.
___id
=
id
;
this
.
id
=
id
;
this
.
id
=
id
;
}
}
let
instance1
,
instance2
;
store
.
sub
(
'appLoaded'
,
function
(
loaded
)
{
store
.
sub
(
'appLoaded'
,
function
(
loaded
)
{
if
(
!
loaded
)
if
(
!
loaded
)
return
;
return
;
let
instance
=
new
RTC
(
document
.
querySelector
(
"#videoinputapp1"
),
camera1canvas
,
'canvas1'
,
1
);
instance1
=
new
RTC
(
document
.
querySelector
(
"#videoinputapp1"
),
camera1canvas
,
'canvas1'
,
1
);
instance
.
mUiRemoteVideoParent
=
remoteVideoEl
;
instance
1
.
mUiRemoteVideoParent
=
remoteVideoEl
;
let
instance2
=
new
RTC
(
document
.
querySelector
(
"#videoinputapp1"
),
camera2canvas
,
'canvas2'
,
2
);
instance2
=
new
RTC
(
document
.
querySelector
(
"#videoinputapp1"
),
camera2canvas
,
'canvas2'
,
2
);
instance2
.
mUiRemoteVideoParent
=
remoteVideoEl
;
instance2
.
mUiRemoteVideoParent
=
remoteVideoEl
;
const
selfieSegmentation1
=
new
SelfieSegmentation
(
{
const
selfieSegmentation1
=
new
SelfieSegmentation
(
{
...
...
src/apps/videoinputapp.ts
View file @
40660135
...
@@ -201,17 +201,24 @@ export class VideoInputApp {
...
@@ -201,17 +201,24 @@ export class VideoInputApp {
}
}
else
if
(
args
.
Type
==
awrtc
.
CallEventType
.
Message
)
{
else
if
(
args
.
Type
==
awrtc
.
CallEventType
.
Message
)
{
//no ui for this yet. simply echo messages for testing
//no ui for this yet. simply echo messages for testing
let
messageArgs
=
args
as
awrtc
.
MessageEventArgs
;
/*
let messageArgs = args as awrtc.MessageEventArgs;
this
.
mCall
.
Send
(
messageArgs
.
Content
,
messageArgs
.
Reliable
,
messageArgs
.
ConnectionId
);
this.mCall.Send(messageArgs.Content, messageArgs.Reliable, messageArgs.ConnectionId);
*/
}
}
else
if
(
args
.
Type
==
awrtc
.
CallEventType
.
DataMessage
)
{
else
if
(
args
.
Type
==
awrtc
.
CallEventType
.
DataMessage
)
{
//no ui for this yet. simply echo messages for testing
//no ui for this yet. simply echo messages for testing
let
messageArgs
=
args
as
awrtc
.
DataMessageEventArgs
;
//
let messageArgs = args as awrtc.DataMessageEventArgs;
this
.
mCall
.
SendData
(
messageArgs
.
Content
,
messageArgs
.
Reliable
,
messageArgs
.
ConnectionId
);
//
this.mCall.SendData(messageArgs.Content, messageArgs.Reliable, messageArgs.ConnectionId);
}
}
else
if
(
args
.
Type
==
awrtc
.
CallEventType
.
CallAccepted
)
{
else
if
(
args
.
Type
==
awrtc
.
CallEventType
.
CallAccepted
)
{
let
arg
=
args
as
awrtc
.
CallAcceptedEventArgs
;
let
arg
=
args
as
awrtc
.
CallAcceptedEventArgs
;
console
.
log
(
"New call accepted id: "
+
arg
.
ConnectionId
.
id
);
console
.
log
(
"New call accepted id: "
+
arg
.
ConnectionId
.
id
);
let
messageArgs
=
args
as
awrtc
.
MessageEventArgs
;
this
.
mCall
.
Send
(
JSON
.
stringify
({
userId
:
store
.
get
(
'userRole'
+
this
.
___id
),
webCam
:
store
.
get
(
'webcam'
+
this
.
___id
)
}),
messageArgs
.
Reliable
,
messageArgs
.
ConnectionId
);
}
}
else
if
(
args
.
Type
==
awrtc
.
CallEventType
.
WaitForIncomingCall
)
{
else
if
(
args
.
Type
==
awrtc
.
CallEventType
.
WaitForIncomingCall
)
{
console
.
log
(
"Waiting for incoming call ..."
);
console
.
log
(
"Waiting for incoming call ..."
);
...
@@ -325,12 +332,6 @@ export class VideoInputApp {
...
@@ -325,12 +332,6 @@ export class VideoInputApp {
this
.
Stop
();
this
.
Stop
();
}
else
{
}
else
{
this
.
Start
(
this
.
mAddress
,
this
.
mAudio
,
this
.
mVideo
);
this
.
Start
(
this
.
mAddress
,
this
.
mAudio
,
this
.
mVideo
);
setTimeout
(()
=>
{
this
.
mCall
.
Send
(
`"userData": `
+
JSON
.
stringify
({
userId
:
store
.
get
(
'userRole'
+
this
.
___id
),
webCam
:
store
.
get
(
'webcam'
+
this
.
___id
)
},
null
,
2
),
true
);
},
2000
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment