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

Renegotiate media with different directions #1137

Open
wants to merge 72 commits into
base: main
Choose a base branch
from
Open

Conversation

iAmmar7
Copy link
Collaborator

@iAmmar7 iAmmar7 commented Oct 25, 2024

Description

ref: https://github.com/signalwire/cloud-product/issues/11648 & #1132

Allow users to renegotiate video, including the downgrade/upgrade of the RTC media peers.

  • A dedicated playwright project cfRenegotiation for Call Fabric renegotiation.

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

// Enable audio with "sendrecv" direction
await call.enableAudio()

// Enable audio with "sendonly" direction
await call.enableAudio({ audio: true, negotiateAudio: false })

// Enable audio with "recvonly" direction
await call.enableAudio({ audio: false, negotiateAudio: true })

// Disable audio while keeps on receiving it
await call.disableAudio({ negotiateAudio: true })

// Disable audio completely
await call.disableAudio()

// Enable video with "sendrecv" direction
await call.enableVideo()

// Enable video with "sendonly" direction
await call.enableVideo({ video: true, negotiateVideo: false })

// Enable video with "recvonly" direction
await call.enableVideo({ video: false, negotiateVideo: true })

// Disable video while keeps on receiving it
await call.disableVideo({ negotiateVideo: true })

// Disable video completely
await call.disableVideo()

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>
// expect(statsAfterDisabling.inboundRTP).not.toHaveProperty('video')

// Assert that outboundRTP.video is either absent or inactive
if (statsAfterDisabling.outboundRTP.video) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we isolate these two cases to make the test more determinist?
In which case, it's expected to exist with active === false.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is something we need to first manually verify. We can try verifying this via WebRTC internals as well.

I observed inconsistent stats after disabling the video in the e2e test.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting...

@iAmmar7 iAmmar7 changed the base branch from joao/renegotiation to main October 29, 2024 14:22
@iAmmar7 iAmmar7 requested review from jpsantosbh and giavac November 1, 2024 10:58
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