Skip to content

Expose PeerConnectionState #211

@alexlapa

Description

@alexlapa

Problem to solve

We want to provide a better indication of a media connection state.

Proposal

Expose PeerConnectionState a getter and on change callback.

This should probably go to ConnectionHandle, so it will be ConnectionHandle.get_state() and ConnectionHandle.on_state_change(). This is pretty straightforward for a P2P mode since RTCPeerConnection is 1-to-1 to the corresponding ConnectionHandle. But its a bit of a mess in SFU mode since there are 4 peers serving a connection between members: this member's rx and tx and that member's rx and tx peers. So the most correct way to implement this would probably be:

enum MemberConnectionState {
  P2P(ConnectionState),
  SFU {
	  local_tx: Option<ConnectionState>,
	  local_rx: Option<ConnectionState>,
	  remote_tx: Option<ConnectionState>,
  	  remote_rx: Option<ConnectionState>,
  }
}

And another thing is that the only way to get remote peers connection state is only if we get notified by server. So this should probably be split in 2 tasks: for P2P and for SFU.

Metadata

Metadata

Assignees

Labels

featureNew feature or requestk::apiRelated to API (application interface)k::designRelated to overall design and/or architecturek::ui/uxRelated to UI/UX experienceplatform::androidSpecific to Android platformplatform::iosSpecific to iOS platformplatform::linuxSpecific to Linux platformplatform::macosSpecific to macOS platformplatform::webSpecific to WEB platformplatform::windowsSpecific to Windows platform

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions