[Webkit-unassigned] [Bug 190346] Mixing media audio with call audio while in WebRTC call (AudioContext issue)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Oct 5 04:22:32 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=190346

--- Comment #8 from David Gölzhäuser <david.goelzhaeuser at loxone.com> ---
I figured out a temporary Workaround.

Here is my use case:
Cordova Based iOS Application which initially receives a VideoTrack from the RTCPeerConnection. Then the user can decide to start a voice call which asks the user for the microphone access and adds the Microphone track to the RTCPeerConnection, this will result in receiving the remote peers microphone stream. However with the drawback of the reduced volume due to the wrong speaker selection.

I worked around it by first add a MediaStream's AudioTrack (created with `audioContext.createMediaStreamDestination().stream`) to the RTCPeerConnection. Then when receiving the remote peers microphone stream the user is asked for the microphone permission using `getUserMedia`. When the user accepts and the microphone stream is available I simply replace the aforementioned track with the microphone track using RTCRtpSender function `replaceTrack`. (The `RTCRtpSender` is returned from the `RTCPeerConnection` method `addTrack`)

However this fix only works once per app livecycle. I am guessing that the `AVAudioSession` gets confused, I tried to reset it using a Cordova Plugin, but it didn't yield the wanted results.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20211005/abdcdb55/attachment.htm>


More information about the webkit-unassigned mailing list