Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CF & Video SDKs: Allow user to update media with renegotiation #1137

Merged
merged 112 commits into from
Jan 30, 2025

Conversation

iAmmar7
Copy link
Collaborator

@iAmmar7 iAmmar7 commented Oct 25, 2024

Description

This PR:

  • Introduces three APIs to update the media, including the downgrade/upgrade of the RTC media peers with renegotiation:
    • updateMedia: Allow users to update audio/video.
    • setVideoDirection: Allow users to update the video direction.
    • setAudioDirection: Allow users to update the audio direction.
  • Refactors the BaseConnection class, specifically methods like: updateConstraints, updateStream, etc, so that these can be used in renegotiation.
  • Introduces a stopTrackReceiver method in RTCPeer to stop the incoming transceiver track.
  • Introduces a promise that should be resolved or rejected based on the negotiation status.
  • Maintains the session connected status inside the WSClient class so that the client can be disconnected based on the status.
  • Updates the invalid session warning.
  • Writes end-to-end tests for both Video and Call Fabric SDKs.
  • Refactors the e2e tests utils file and groups together the utilities.
  • Disconnects the Call Fabric client after each test completion.
  • Introduces a dedicated playwright project renegotiation.

ref: #1132

Type of change

  • Internal refactoring
  • Bug fix (bugfix - non-breaking)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Code snippets

await updateMedia({
  audio: {
    enable: true,
    direction: 'send' | 'sendrecv',
    constraints?: MediaTrackConstraints
  },
  video: {
    enable: false,
    direction: 'none' | 'receive'
  }
})

// Either "audio" or "video" is required with "enable" and "direction" properties.
// The "constraints" can only be passed if the "enable" is "true".

await setVideoDirection('send' | 'sendrecv' | 'none' | 'receive')

await setAudioDirection('send' | 'sendrecv' | 'none' | 'receive')

jpsantosbh and others added 30 commits July 17, 2024 09:05
Co-authored-by: Ammar Ansari <iammaransari@gmail.com>
Co-authored-by: Ammar Ansari <iammaransari@gmail.com>
Co-authored-by: Ammar Ansari <iammaransari@gmail.com>
Co-authored-by: Ammar Ansari <iammaransari@gmail.com>
Co-authored-by: Ammar Ansari <iammaransari@gmail.com>
Co-authored-by: Ammar Ansari <iammaransari@gmail.com>
Co-authored-by: Ammar Ansari <iammaransari@gmail.com>
Co-authored-by: Ammar Ansari <iammaransari@gmail.com>
@iAmmar7 iAmmar7 requested a review from giavac January 21, 2025 13:43
@iAmmar7 iAmmar7 requested a review from giavac January 22, 2025 12:26
giavac
giavac previously approved these changes Jan 30, 2025
@iAmmar7 iAmmar7 merged commit 2dc5db8 into main Jan 30, 2025
22 of 25 checks passed
@iAmmar7 iAmmar7 deleted the aa/renegotiation branch January 30, 2025 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants