5 Replies
      Latest reply on May 10, 2019 9:27 AM by TidBits
      jeffro37 Level 1 Level 1 (0 points)

        I have an app that plays video in an AVPlayerViewController that also has some overlays on it.

         

        I'd like to be able to mirror the entire app, but when I attempt this, only the video displayed in the AVPlayerViewController AirPlays, while the rest of the UI (including the overlays) remains on the iOS device.

         

        Short of basically reworking the mirroring functionality manually via the Multiple Display Mirroring Guide (using UIScreenDidConnectNotification & UIScreenDidDisconnectNotification and mirroring the second screen), is there any way for me to make mirroring work in full with the AVPlayerViewController on screen?

        • Re: AirPlay mirroring with AVPlayerViewController - I want to mirror the entire primary window
          TidBits Apple Staff Apple Staff (1,645 points)

          The method that you describe (using screen connection notifications and establishing a second window on the second UIScreen) is the recommended path for achieving what you are trying to do. Basic AirPlay video playback does not allow for the addition of any UI elements on the secondary screen.

          1 of 1 people found this helpful
            • Re: AirPlay mirroring with AVPlayerViewController - I want to mirror the entire primary window
              fkeufss Level 1 Level 1 (0 points)

              Hello TidBits,

               

              Your answers also caught my interest as I am trying to do similar things. Basically, what I want is to display some overlay image on top of video, like a image logo with transpeancy alpha channel. This can be done easily on the phone. However, when video is casted on AirPlay and when the property of AVPlayer "usesExternalPlaybackWhileExternalScreenIsActive" is set to true, it seems that I cannot place any other view on the secondary screen.

               

              You said "Basic AirPlay video playback does not allow for the addition of any UI elements on the secondary screen.". So if I really want to have this feature implemented, is there any possbility and what can you suggest?

                • Re: AirPlay mirroring with AVPlayerViewController - I want to mirror the entire primary window
                  TidBits Apple Staff Apple Staff (1,645 points)

                  The only way would be to add a window to the second UIScreen, which would then allow you to put the video player layer on that second screen and overlay visual elements on top.

                   

                  However, we'd not recommend this as it is likely to impact video quality, and also would prevent users from making use of their phone during video playback. Playback would stop as soon as the device goes to sleep or the app goes into the background.

                   

                  We would ask that you request this feature and capability as part of AirPlay video at bugreporter.apple.com