Close Menu
  • Home
  • AI
  • Big Data
  • Cloud Computing
  • iOS Development
  • IoT
  • IT/ Cybersecurity
  • Tech
    • Nanotechnology
    • Green Technology
    • Apple
    • Software Development
    • Software Engineering

Subscribe to Updates

Get the latest technology news from Bigteetechhub about IT, Cybersecurity and Big Data.

    What's Hot

    Israel Hamas deal: The hostage, ceasefire, and peace agreement could have a grim lesson for future wars.

    October 14, 2025

    Astaroth: Banking Trojan Abusing GitHub for Resilience

    October 13, 2025

    ios – Differences in builds between Xcode 16.4 and Xcode 26

    October 13, 2025
    Facebook X (Twitter) Instagram
    Facebook X (Twitter) Instagram
    Big Tee Tech Hub
    • Home
    • AI
    • Big Data
    • Cloud Computing
    • iOS Development
    • IoT
    • IT/ Cybersecurity
    • Tech
      • Nanotechnology
      • Green Technology
      • Apple
      • Software Development
      • Software Engineering
    Big Tee Tech Hub
    Home»iOS Development»ios – video freezes when Picture-in-Picture is hidden offscreen
    iOS Development

    ios – video freezes when Picture-in-Picture is hidden offscreen

    big tee tech hubBy big tee tech hubAugust 19, 2025002 Mins Read
    Share Facebook Twitter Pinterest Copy Link LinkedIn Tumblr Email Telegram WhatsApp
    Follow Us
    Google News Flipboard
    ios – video freezes when Picture-in-Picture is hidden offscreen
    Share
    Facebook Twitter LinkedIn Pinterest Email Copy Link


    I’m building an iOS app using Twilio Video 5.10 with Swift. The app supports video calls and works correctly in Picture in Picture (PiP) mode.
    However, I’ve noticed an issue:

    • When I activate PiP, the local camera feed streams normally to the remote participant.
    • If I swipe the PiP window offscreen (hidden at the edge of the display), the remote participant sees my video frozen.
    • Audio continues working, but the video stays frozen until I bring the PiP window back onscreen.

    Is this expected behavior in iOS PiP with Twilio Video, or is there a workaround to keep the camera feed active while the PiP window is hidden?

    I set my CameraSourceOptions enableCameraMultitasking to true
    also added com.apple.developer.avfoundation.multitasking-camera-access to my .entitlements

    here my CameraManager class:

    import TwilioVideo
    import AVFoundation
    
    protocol CameraManagerDelegate: AnyObject {
        func trackSourceWasInterrupted(track: LocalVideoTrack)
        func trackSourceInterruptionEnded(track: LocalVideoTrack)
    }
    
    final class CameraManager: NSObject {
        weak var delegate: CameraManagerDelegate?
    
        let track: LocalVideoTrack
        private let source: CameraSource
    
        var position: AVCaptureDevice.Position {
            get { source.device?.position ?? .unspecified }
            set {
                guard let device = CameraSource.captureDevice(position: newValue) else {
                    print("No capture device for \(newValue)")
                    return
                }
                source.selectCaptureDevice(device) { _, _, error in
                    if let error { print("Select device error: \(error)") }
                }
            }
        }
    
        deinit { source.stopCapture() }
    
        init?(position: AVCaptureDevice.Position = .front) {
            let options = CameraSourceOptions { builder in
                builder.enableCameraMultitasking = true
            }
    
            guard let source = CameraSource(options: options, delegate: nil) else {
                print("Unable to create CameraSource"); return nil
            }
            guard let track = LocalVideoTrack(source: source, enabled: true, name: "camera") else {
                print("Unable to create LocalVideoTrack"); return nil
            }
    
            self.source = source
            self.track = track
            super.init()
            self.source.delegate = self
    
            if let device = CameraSource.captureDevice(position: position) {
                let config = CameraConfigFactory().makeCameraConfigFactory(captureDevice: device)
                source.requestOutputFormat(config.outputFormat)
                source.startCapture(device: device, format: config.inputFormat) { _, _, error in
                    if let error { print("Start capture error: \(error)") }
                }
            }
        }
    }
    
    extension CameraManager: CameraSourceDelegate {
        func cameraSourceWasInterrupted(source: CameraSource, reason: AVCaptureSession.InterruptionReason) {
            print("Camera interruption began: \(reason)")
            delegate?.trackSourceWasInterrupted(track: track)
        }
    
        func cameraSourceInterruptionEnded(source: CameraSource) {
            print("Camera interruption ended")
            delegate?.trackSourceInterruptionEnded(track: track)
        }
    
        func cameraSourceDidFail(source: CameraSource, error: any Error) {
            print("Camera source failed: \(error)")
        }
    }
    



    Source link

    freezes Hidden iOS offscreen PictureinPicture Video
    Follow on Google News Follow on Flipboard
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Copy Link
    tonirufai
    big tee tech hub
    • Website

    Related Posts

    ios – Differences in builds between Xcode 16.4 and Xcode 26

    October 13, 2025

    ios – Apple mapkit route function dose not works in China

    October 12, 2025

    swift – Does UIDevice.current.identifierForVendor change after iCloud backup and restore on another iOS device?

    October 11, 2025
    Add A Comment
    Leave A Reply Cancel Reply

    Editors Picks

    Israel Hamas deal: The hostage, ceasefire, and peace agreement could have a grim lesson for future wars.

    October 14, 2025

    Astaroth: Banking Trojan Abusing GitHub for Resilience

    October 13, 2025

    ios – Differences in builds between Xcode 16.4 and Xcode 26

    October 13, 2025

    How to run RAG projects for better data analytics results

    October 13, 2025
    Advertisement
    About Us
    About Us

    Welcome To big tee tech hub. Big tee tech hub is a Professional seo tools Platform. Here we will provide you only interesting content, which you will like very much. We’re dedicated to providing you the best of seo tools, with a focus on dependability and tools. We’re working to turn our passion for seo tools into a booming online website. We hope you enjoy our seo tools as much as we enjoy offering them to you.

    Don't Miss!

    Israel Hamas deal: The hostage, ceasefire, and peace agreement could have a grim lesson for future wars.

    October 14, 2025

    Astaroth: Banking Trojan Abusing GitHub for Resilience

    October 13, 2025

    Subscribe to Updates

    Get the latest technology news from Bigteetechhub about IT, Cybersecurity and Big Data.

      • About Us
      • Contact Us
      • Disclaimer
      • Privacy Policy
      • Terms and Conditions
      © 2025 bigteetechhub.All Right Reserved

      Type above and press Enter to search. Press Esc to cancel.