Unity-Technologies / Unity-Technologies/com.unity.webrtc

[REQUEST]: Add OnSignalingStateChange property to RTCPeerConnection class

Open
#1,036 0 comments 1 reaction 1 assignee View on GitHub

@karasusan is already working on this.

Since May 24, 2024.

enhancement
Dominant language
Assembly
Stars
852
Forks
238
PR merge metrics
No merged PRs in 30d

Description

Is your feature request related to a problem?

The javascript implementations of the WebRTC APIs in most browser emit a signalingstatechange event to an RTCPeerConnection to notify it that its signaling state, as indicated by the signalingState property, has changed (see here).
However RTCPeerConection in Unity's WebRTC implementation does not emit such an event. Therefore you must keep checking if the value of the SignalingState property changes in a Coroutine / Task / etc. This produces unnecessary overhead.

Describe the solution you'd like

Add a OnSignalingStateChange property to the RTCPeerConnection class of type DelegateOnSignalingStateChange. The DelegateOnSignalingStateChange delegate type should accept a variable of type RTCSignalingState. Any event handlers registered to the OnSignalingStateChange property should be called whenever the value of the SignalingState property of the RTCPeerConnection instance changes.

Describe alternatives you've considered

No response

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.