summary refs log tree commit diff
path: root/webrtc/src/opcodes/Connect.ts
blob: 1f874a4413afb9177770e0182893232c99a47863 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { WebSocket } from "@fosscord/gateway";
import { Payload } from "./index";
import { Server } from "../Server"

/*
Sent by client:

{
    "op": 12,
    "d": {
        "audio_ssrc": 0,
        "video_ssrc": 0,
        "rtx_ssrc": 0,
        "streams": [
            {
                "type": "video",
                "rid": "100",
                "ssrc": 0,
                "active": false,
                "quality": 100,
                "rtx_ssrc": 0,
                "max_bitrate": 2500000,
                "max_framerate": 20,
                "max_resolution": {
                    "type": "fixed",
                    "width": 1280,
                    "height": 720
                }
            }
        ]
    }
}
*/

export async function onConnect(this: Server, socket: WebSocket, data: Payload) {
	socket.send(JSON.stringify({	//what is op 15?
		op: 15,
		d: { any: 100 }
	}))
}