Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
galene
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
nexedi
galene
Commits
b6adc0b9
Commit
b6adc0b9
authored
Aug 12, 2020
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename Connection to Stream in the JS code.
parent
675035ab
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
static/sfu.js
static/sfu.js
+8
-8
No files found.
static/sfu.js
View file @
b6adc0b9
...
...
@@ -34,7 +34,7 @@ function randomid() {
return
toHex
(
a
);
}
function
Connection
(
id
,
pc
)
{
function
Stream
(
id
,
pc
)
{
this
.
id
=
id
;
this
.
kind
=
null
;
this
.
label
=
null
;
...
...
@@ -47,11 +47,11 @@ function Connection(id, pc) {
this
.
stats
=
{};
}
Connection
.
prototype
.
setInterval
=
function
(
f
,
t
)
{
Stream
.
prototype
.
setInterval
=
function
(
f
,
t
)
{
this
.
timers
.
push
(
setInterval
(
f
,
t
));
};
Connection
.
prototype
.
close
=
function
(
sendit
)
{
Stream
.
prototype
.
close
=
function
(
sendit
)
{
while
(
this
.
timers
.
length
>
0
)
clearInterval
(
this
.
timers
.
pop
());
...
...
@@ -492,7 +492,7 @@ function setMedia(id) {
mine
=
false
;
}
if
(
!
c
)
throw
new
Error
(
'
Unknown
connection
'
);
throw
new
Error
(
'
Unknown
stream
'
);
let
peersdiv
=
document
.
getElementById
(
'
peers
'
);
...
...
@@ -750,7 +750,7 @@ async function gotOffer(id, labels, offer, renegotiate) {
let
pc
=
new
RTCPeerConnection
({
iceServers
:
iceServers
,
});
c
=
new
Connection
(
id
,
pc
);
c
=
new
Stream
(
id
,
pc
);
down
[
id
]
=
c
;
c
.
pc
.
onicecandidate
=
function
(
e
)
{
...
...
@@ -861,7 +861,7 @@ function send(m) {
throw
(
new
Error
(
'
Sending null message
'
));
if
(
socket
.
readyState
!==
socket
.
OPEN
)
{
// send on a closed connection doesn't throw
throw
(
new
Error
(
'
Connection
is not open
'
));
throw
(
new
Error
(
'
Stream
is not open
'
));
}
return
socket
.
send
(
JSON
.
stringify
(
m
));
}
...
...
@@ -1205,7 +1205,7 @@ async function newUpStream(id) {
if
(
up
[
id
])
{
up
[
id
].
close
(
false
);
}
up
[
id
]
=
new
Connection
(
id
,
pc
);
up
[
id
]
=
new
Stream
(
id
,
pc
);
pc
.
onnegotiationneeded
=
async
e
=>
{
try
{
...
...
@@ -1246,7 +1246,7 @@ async function newUpStream(id) {
async
function
negotiate
(
id
,
restartIce
)
{
let
c
=
up
[
id
];
if
(
!
c
)
throw
new
Error
(
'
unknown
connection
'
);
throw
new
Error
(
'
unknown
stream
'
);
if
(
typeof
(
c
.
pc
.
getTransceivers
)
!==
'
function
'
)
throw
new
Error
(
'
Browser too old, please upgrade
'
);
...
...
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