Audio not shared while sharing screen

We have integrated screen sharing but the audio of videos played on the device from which screen is shared is not audible to other participants. The audio via mic is audible. We are using custom UI.

Which version?
mobileRTCVersion - 4.6.21666.0428


When we start broadcasting this particular UI doesn’t appear in our custom UI. Which method is called to toggle Share Device Audio. Please refer to the screenshot.

code used to start broadcast
if #available(iOS 12.0, *) {
let broadcastView = RPSystemBroadcastPickerView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.size.width / 2, height: UIScreen.main.bounds.size.height / 2))
broadcastView.preferredExtension = “”

let buttonPressed = NSSelectorFromString("buttonPressed:")
if broadcastView.responds(to: buttonPressed) {
    for subview in broadcastView.subviews {
        if let button = subview as? UIButton {
            button.sendActions(for: UIControl.Event.allTouchEvents)
} else {
    // Fallback on earlier versions


Smartphone (please complete the following information):

  • Device: iPhone 6 plus–Software version- 12.4.6 / iPhone 11–Software version- 13.3.1

Additional context
Is there any way we can toggle the Share Device Audio programmatically in our own custom UI.

Hi @alexander.j,

Thanks for the post. Based on the code snippet, it seems like you are using Custom UI. The audio share interface is currently not available in the Custom UI. I have forwarded this as a feature request to the engineering team.