WebRTC state. Return to WebRTC service
1: package com.voipplus.mmsclient.WebRTC;
2:
3: public enum WebRTCState {
4: IDLE, // Initial state
5: CONNECTING_WEBSOCKET, // WebSocket is initializing
6: WEBSOCKET_CONNECTED, // WebSocket is ready
7: CREATING_PEER_CONNECTION, // PeerConnection is initializing
8: CREATING_OFFER, // Creating SDP offer
9: WAITING_FOR_ANSWER, // Waiting for remote SDP answer
10: ESTABLISHED, // DataChannel open and communication ready
11: ERROR // Some failure occurred
12: }
13:
14: /*
15: ✅ 1️⃣ Setup Phase
16: • peerConnectionFactory (First)
17: • signalingServerUrl (Set before initWebSocket)
18: • initWebSocket() (WebSocket must be ready before connection starts)
19: ✅ 2️⃣ Connection Setup
20: • peerConnection (Created AFTER WebSocket)
21: • dataChannel (Requires peerConnection)
22: • localAudioTrack (Requires peerConnectionFactory)
23: • localVideoTrack (Requires peerConnectionFactory)
24: • peerConnection.addStream(mediaStream);
25: ✅ 3️⃣ Signaling & Connection
26: • Send SDP Offer → peerConnection.setLocalDescription()
27: • Receive SDP Answer → peerConnection.setRemoteDescription()
28: • ICE Candidate Exchange → peerConnection.addIceCandidate()
29: ✅ 4️⃣ Data Transfer
30: • Wait for dataChannel.state == OPEN
31: • Send & Receive Messages
32: ✅ 5️⃣ Handle Disconnections
33: • WebSocket Reconnect
34: • ICE Restart on Disconnection
35: */
36:
Return to WebRTC service
Android context:
Testing context:
Comments (
)
)
Link to this page:
http://www.vb-net.com/AndroidMosaic/State.htm
|
|