-
-
Notifications
You must be signed in to change notification settings - Fork 125
WebRTC
The core of the streaming is based on the RTC protocol. In this project we used WebRTC to set up the handshake and authentication.
During the setup we need 2 things from the Xbox Streaming API:
- SDP (Session Description protocol)
- ICE Candidate (Interactive Connectivity Establishment)
For xHomestreaming the SRTP key from the configuration call is not being used. After setting the ICE candidates in your WebRTC configuration the client should open 6 data channels. The configuration for the data channels are as followed:
'video': {
id: 1,
ordered: true,
protocol: '1.0'
},
'audio': {
id: 2,
maxRetransmits: 0,
ordered: true,
protocol: 'audioV1'
},
'input': {
id: 3,
ordered: true,
protocol: '1.0'
},
'control': {
id: 4,
protocol: 'controlV1'
},
'message': {
id: 5,
protocol: 'messageV1'
},
'chat': {
id: 6,
protocol: "chatV1"
}
Once the data channels are opened you have to process the incoming packets. Without sending any data back the stream will only last for +- 40 seconds. After this the stream will automatically close.
To maintain the stream, you have to send data back to the Xbox via the input
channel. You have to confirm the packets back that you have processed.