Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sfu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alain Takoudjou
sfu
Commits
52c4f1a3
Commit
52c4f1a3
authored
Aug 12, 2020
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restructure offers.
parent
bc7bd36b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
10 deletions
+16
-10
static/sfu.js
static/sfu.js
+2
-2
webclient.go
webclient.go
+14
-8
No files found.
static/sfu.js
View file @
52c4f1a3
...
...
@@ -646,7 +646,7 @@ function serverConnect() {
let
m
=
JSON
.
parse
(
e
.
data
);
switch
(
m
.
type
)
{
case
'
offer
'
:
gotOffer
(
m
.
id
,
m
.
labels
,
m
.
offer
,
!!
m
.
renegotiate
);
gotOffer
(
m
.
id
,
m
.
labels
,
m
.
offer
,
m
.
kind
===
'
renegotiate
'
);
break
;
case
'
answer
'
:
gotAnswer
(
m
.
id
,
m
.
answer
);
...
...
@@ -1276,10 +1276,10 @@ async function negotiate(id, restartIce) {
send
({
type
:
'
offer
'
,
kind
:
'
renegotiate
'
,
id
:
id
,
labels
:
c
.
labelsByMid
,
offer
:
offer
,
renegotiate
:
true
,
});
}
...
...
webclient.go
View file @
52c4f1a3
...
...
@@ -173,17 +173,16 @@ func (v rateMap) MarshalJSON() ([]byte, error) {
type
clientMessage
struct
{
Type
string
`json:"type"`
Kind
string
`json:"kind,omitempty"`
Id
string
`json:"id,omitempty"`
Username
string
`json:"username,omitempty"`
Password
string
`json:"password,omitempty"`
Permissions
clientPermission
`json:"permissions,omitempty"`
Group
string
`json:"group,omitempty"`
Value
string
`json:"value,omitempty"`
Kind
string
`json:"kind,omitempty"`
Offer
*
webrtc
.
SessionDescription
`json:"offer,omitempty"`
Answer
*
webrtc
.
SessionDescription
`json:"answer,omitempty"`
Candidate
*
webrtc
.
ICECandidateInit
`json:"candidate,omitempty"`
Renegotiate
bool
`json:"renegotiate,omitempty"`
Labels
map
[
string
]
string
`json:"labels,omitempty"`
Request
rateMap
`json:"request,omitempty"`
}
...
...
@@ -431,12 +430,17 @@ func negotiate(c *webClient, down *rtpDownConnection, renegotiate, restartIce bo
}
}
kind
:=
""
if
renegotiate
{
kind
=
"renegotiate"
}
return
c
.
write
(
clientMessage
{
Type
:
"offer"
,
Id
:
down
.
i
d
,
Offer
:
&
offer
,
Renegotiate
:
renegotiate
,
Labels
:
labels
,
Type
:
"offer"
,
Kind
:
kin
d
,
Id
:
down
.
id
,
Offer
:
&
offer
,
Labels
:
labels
,
})
}
...
...
@@ -964,7 +968,9 @@ func handleClientMessage(c *webClient, m clientMessage) error {
if
m
.
Offer
==
nil
{
return
protocolError
(
"null offer"
)
}
err
:=
gotOffer
(
c
,
m
.
Id
,
*
m
.
Offer
,
m
.
Renegotiate
,
m
.
Labels
)
err
:=
gotOffer
(
c
,
m
.
Id
,
*
m
.
Offer
,
m
.
Kind
==
"renegotiate"
,
m
.
Labels
,
)
if
err
!=
nil
{
log
.
Printf
(
"gotOffer: %v"
,
err
)
return
failConnection
(
c
,
m
.
Id
,
"negotiation failed"
)
...
...
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