twilio / video-quickstart-ios

Twilio Video Quickstart for iOS
https://www.twilio.com/docs/api/video
MIT License
457 stars 177 forks source link

Is there a way of playback the App sound at the same time with the WebView sound? #593

Closed Fanpei920 closed 3 years ago

Fanpei920 commented 3 years ago

Description

Is there a way of playback the App sound at the same time with the WebView sound?

Steps to Reproduce

For example we use the "ReplayKit Example" and "Start Conference" example (internally using RPScreenRecorder.)

  1. [Step one] Click "Start Conference" and join the room, then you can able to hear the remote participant.

  2. [Step two] Launch the webview and play some video.

Code

"ReplayKit Example"

Expected Behavior

Can hear the webview's audio and the remote participant's audio at same time.

Actual Behavior

Become unable to hear the remote participant's audio, instead of App's audio started to playback.

Reproduces How Often

100%

Video iOS SDK

4.3.0

iOS Device

14.4

Discussion

I've tried to use the code below but it seems can't work.

try AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.playAndRecord, options: [.mixWithOthers])
try AVAudioSession.sharedInstance().setActive(true)

Thanks!

Fanpei920 commented 3 years ago

Self resolved!