|
2 | 2 |
|
3 | 3 | **The Unity Render Streaming** package provides two different signaling protocols as examples.
|
4 | 4 |
|
5 |
| -- HttpSignaling |
6 |
| -- WebSocketSignaling |
| 5 | +- `HttpSignaling` |
| 6 | +- `WebSocketSignaling` |
7 | 7 |
|
8 | 8 | In the example, the schema given to `URL Signaling` is used to determine which protocol to use.
|
9 | 9 |
|
10 | 10 | 
|
11 | 11 |
|
12 |
| -If it starts with `http`, HttpSignaling is used. If it starts with `ws`, WebSocketSignaling is used. |
| 12 | +If it starts with `http`, `HttpSignaling` is used. If it starts with `ws`, `WebSocketSignaling` is used. |
13 | 13 |
|
14 | 14 | ## HttpSignaling
|
15 |
| -Signaling is handled by Http Request. |
| 15 | +Signaling is handled by HTTP Request. |
16 | 16 | The signalling server is polled at specified intervals to obtain the Offer and Candidate of the difference from the last time.
|
17 | 17 |
|
18 | 18 | ## WebSocketSignaling
|
19 | 19 | Signaling is handled by WebSocket.
|
20 | 20 | When the signaling server receives the Offer or Candidate, the server distributes it to the connected clients.
|
21 | 21 | > [!WARNING]
|
22 | 22 | > WebSocket does not work in iOS Safari on servers that use self-signed certificates.
|
23 |
| -> If you want to verify the behavior of WebSocket signaling in iOS Safari, use a certificate issued by a trusted certification authority. Or try signaling with Http. |
24 |
| -
|
25 |
| -## Proprietary Signaling Class |
26 |
| -Both of the signaling classes implement `ISignaling`. |
27 |
| -If you want to create your own signaling class, you can inherit `ISignaling` to use it directly from the UnityRenderStreaming class. |
28 |
| -The following is a description of each method. |
29 |
| - |
30 |
| -``` |
31 |
| -void Start(); |
32 |
| -``` |
33 |
| -- A method to call when starting signaling. |
34 |
| -- In the sample, we are establishing a session with the server for each protocol. |
35 |
| - |
36 |
| -``` |
37 |
| -void Stop(); |
38 |
| -``` |
39 |
| -A method to call when you want to stop signaling. |
40 |
| -In the sample, we are terminating the session with the server for each protocol. |
41 |
| - |
42 |
| -``` |
43 |
| -public delegate void OnOfferHandler(ISignaling signaling, DescData e); |
44 |
| -event OnOfferHandler OnOffer; |
45 |
| -``` |
46 |
| -- This is a delegate that registers the process to be performed when a new Offer is received by signaling. |
47 |
| - |
48 |
| -``` |
49 |
| -public delegate void OnAnswerHandler(ISignaling signaling, DescData e); |
50 |
| -event OnAnswerHandler OnAnswer; |
51 |
| -``` |
52 |
| -- This is a delegate that registers the process to be performed when a new Answer is received by signaling. |
53 |
| -- In the current version, it is not used in Unity because it does not receive Answers. |
54 |
| - |
55 |
| -``` |
56 |
| -public delegate void OnIceCandidateHandler(ISignaling signaling, CandidateData e); |
57 |
| -event OnIceCandidateHandler OnIceCandidate; |
58 |
| -``` |
59 |
| -- This is a delegate that registers the process to be performed when it receives a new Candidate by signaling. |
60 |
| - |
61 |
| -``` |
62 |
| -void SendOffer(); |
63 |
| -``` |
64 |
| -- A method to call when sending an Offer in signaling. |
65 |
| -- In the current version, it is not implemented in the sample because it is not possible to send Offer from Unity. |
66 |
| - |
67 |
| -``` |
68 |
| -void SendAnswer(string connectionId, RTCSessionDescription answer); |
69 |
| -``` |
70 |
| -- A method to call when sending an Answer in signaling. |
71 |
| - |
72 |
| -``` |
73 |
| -void SendCandidate(string connectionId, RTCIceCandidate candidate); |
74 |
| -``` |
75 |
| -- A method to call when sending a Candidate in signaling. |
| 23 | +> If you want to verify the behavior of WebSocket signaling in iOS Safari, use a certificate issued by a trusted certification authority. Or try signaling with HTTP. |
0 commit comments