Skip to content
This repository has been archived by the owner on Dec 2, 2023. It is now read-only.

Multi stream #24

Merged
merged 16 commits into from
Dec 9, 2019
47 changes: 25 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,29 @@ ION is a distributed RTC system written by pure go and flutter

## Architecture

![arch](docs/imgs/arch.png)
![ion](docs/imgs/ion.png)
## Features

- [x] Pure GO
- [x] GO mod support
- [x] CentOS support
- [x] Script support CentOS
- [x] SFU
- [x] Signal protocol by protoo
- [x] WebRTC stack by pion
- [x] Nack support
- [x] PLI support
- [x] Anti-Loss-Package 30%~50%(local test by Eye/Network-Link-Conditioner)
- [x] Distributed System
- [x] Ion-Ion rtp relay
- [x] MQ support

- [x] SDK
- [x] JS SDK
- [x] Flutter SDK
- [x] Server
- [x] OS
- [x] CentOS 7
- [x] macOS Mojave
- [x] Signal
- [x] WebSocket
- [x] Media
- [x] WebRTC
- [x] RTP/RTCP
- [x] Nack
- [x] PLI
- [x] Anti-Loss-Package 30%~50%
- [x] Distributed System
- [x] ION-ION RTP relay
- [x] MQ support
- [x] Client
- [x] SDK
- [x] Flutter
- [x] JS
- [x] Demo


## Contributing
Expand All @@ -51,18 +54,18 @@ Welcome contributing to ion!
```
### 2. build
```
//centos
#centos
./scripts/centos/installDeps.sh

//mac
#mac
./scripts/mac/installDeps.sh
```
### 3. run
```
//centos
#centos
./scripts/centos/allRestart.sh

//mac
#mac
./scripts/mac/allRestart.sh
```
### 4. let's chat
Expand Down
File renamed without changes
65 changes: 37 additions & 28 deletions docs/protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ This protocol base on [protoo](https://protoojs.org/#protoo)
```
method:join
data:{
"rid":"$roomid"
"rid": "$roomId",
"info":{"name": "$name"}
}
```

Expand All @@ -41,7 +42,7 @@ Somebody will receive "stream-add" if there are some publishers in this room
```
method:leave
data:{
"rid":"$roomid"
"rid":"$roomId"
}
```

Expand All @@ -64,16 +65,18 @@ Subscriber will receive "stream-remove" when publisher leave this room
```
method:publish
data:{
"jsep": {"type": "offer","sdp": "..."}
"options": {"codec": "h264"}
"jsep": {"type": "offer","sdp": "..."},
"options": {"codec": "H264", "video": true, "audio": true, "screen": false}
}
```
codec should be H264 or VP8

#### response
```
//success
ok:true
data:{
"mid": "$mediaId"
"jsep": {"type": "answer","sdp": "..."}
}

Expand All @@ -89,7 +92,8 @@ errCode:-1
```
method:unpublish
data:{
"rid":"$roomid"
"rid": "$roomId",
"mid": "$mediaId"
}
```

Expand All @@ -111,7 +115,8 @@ errCode:-1
```
method:subscribe
data:{
"pid:"$pid",
"rid": "$roomId",
"mid": "$mediaId",
"jsep": {"type": "offer","sdp": "..."}
}
```
Expand All @@ -135,7 +140,8 @@ errCode:-1
```
method:unsubscribe
data:{
"pid": "$pid"
"rid": "$roomId",
"mid": "$mediaId"
}
```

Expand Down Expand Up @@ -218,7 +224,8 @@ People can subscribe while receiving "stream-add" in this room
```
method:stream-add
data:{
"pid": "$pid"
"rid": "$roomId",
"mid": "$mediaId"
}
```

Expand All @@ -245,7 +252,8 @@ subscribers need to release resources(pc,player,etc.) when they receive "stream-
```
method:stream-remove
data:{
"pid": "$pid"
"rid": "$roomId",
"mid": "$mediaId"
}
```

Expand Down Expand Up @@ -278,8 +286,9 @@ Islb will broadcast this msg to all ions
```
method:peer-join
data:{
"rid": "$rid"
"id": "$id"
"rid": "$rid",
"id": "$id",
"info":{"name": "$name"}
}
```

Expand Down Expand Up @@ -336,15 +345,15 @@ Then ion can send these infomation to this new joiner by signal
```
{
"method": "getPubs",
"rid": "$roomid",
"pid": "$pid"
"rid": "$roomId",
"skipId": "$skipId"
}
```

#### response1
```
{
"pid": "$pid1",
"mid": "$mediaId1",
"info": "$info1"
}

Expand All @@ -354,7 +363,7 @@ Then ion can send these infomation to this new joiner by signal

```
{
"pid": "$pid2",
"mid": "$mediaId2",
"info": "$info2"
}
```
Expand All @@ -370,9 +379,9 @@ ion will send "stream-add" to islb when client start publishing
```
{
"method": "stream-add",
"rid": "$roomid",
"pid": "$pid",
"info": {"$SSRC": $payloadType}
"rid": "$roomId",
"mid": "$meidaId",
"mediaInfo": {"$SSRC": $payloadType}
}
```

Expand All @@ -385,8 +394,8 @@ ion send "keepAlive" to islb periodically when publish stream success
```
{
"method": "keepAlive",
"rid": "$roomid",
"pid": "$pid",
"rid": "$roomId",
"mid": "$meidaId",
"info": {"$SSRC": $payloadType}
}
```
Expand All @@ -398,8 +407,8 @@ Ion will send "stream-remove" to islb when client unpublish stream
```
{
"method": "stream-remove",
"rid": "$roomid",
"pid": "$pid"
"rid": "$roomId",
"mid": "$meidaId"
}
```

Expand All @@ -412,8 +421,8 @@ Ion will send "relay" to islb when publisher is on other ion
```
{
"method": "relay",
"rid": "$roomid",
"pid": "$pid"
"rid": "$roomId",
"mid": "$meidaId"
}
```

Expand All @@ -426,8 +435,8 @@ Ion will send "getMediaInfo" to islb when publishing is on other ion
```
{
"method": "getMediaInfo",
"rid": "$roomid",
"pid": "$pid"
"rid": "$roomId",
"mid": "$meidaId"
}
```

Expand All @@ -440,8 +449,8 @@ Ion will send "unRelay" to islb when this rtp-pub has no sub, and islb will cont
```
{
"method": "unRelay",
"rid": "$roomid",
"pid": "$pid"
"rid": "$roomId",
"mid": "$meidaId"
}
```

Expand Down
Loading