Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible now to record screen on iOS 11?

Tags:

ios11

swift3

Today I saw some videos that apple gave the option to record screen in control center.

I am curious if it is also available for developers or not?

I googled but didn't found any doc related to this. Can someone put some light on this topic.

like image 764
Rahul Avatar asked Jun 07 '17 07:06

Rahul


People also ask

Does iOS 11 have Screen Recording?

Enable Screen Recording To use the new screen recording feature in iOS 11, you'll first need to add the feature's button to Control Center. Open Settings, swipe down to Control Center and scroll down to MORE CONTROLS. Then, you'll need to tap the green plus button next to Screen Recording.

Is there a recorder on iPhone 11?

With the Voice Memos app (located in the Utilities folder), you can use iPhone as a portable recording device to record personal notes, classroom lectures, musical ideas, and more. You can fine-tune your recordings with editing tools like trim, replace, and resume.

What iOS can screen record?

All iPhones with iOS 11 or later have a built-in screen recording function. But before learning how to screen record on an iPhone, check to see if the screen record button is in the Control Center; if it's not, be sure to add it. Doing so will make it easier and faster to start recording.


1 Answers

App Screen Sharing:

As per the new update in API docs you can capture Video & Audio of the screen through your app only.

enter image description here

RPScreenRecorder : The shared recorder object providing the ability to record audio and video of your app.

By this class, you can record your app screen and also bind audio through the iPhone microphone.

Below are some methods that you can use to record the screen with different options.

To Accessing the Shared Recorder:

class func shared()

To Controlling App Recording:

-- Starts recording the app display.
func startRecording(handler: ((Error?) -> Void)? = nil)

-- Stops the current recording.
func stopRecording(handler: ((RPPreviewViewController?, Error?) -> Void)? = nil)

-- Starts screen and audio capture.
func startCapture(handler: ((CMSampleBuffer, RPSampleBufferType, Error?) -> Void)?, completionHandler: ((Error?) -> Void)? = nil)

-- Stops screen capture
func stopCapture(handler: ((Error?) -> Void)? = nil)

Hope this will helps you to capture the screen in your app.

Ref Link: https://developer.apple.com/documentation/replaykit/rpscreenrecorder

Doc Ref: https://developer.apple.com/library/content/releasenotes/General/WhatsNewIniOS/Articles/iOS_11_0.html

Late Post but may be useful for those who are still searching related to this question.

iPhone Screen Sharing:

I have done some R&D on the sharing screen and come up with the below updates.

WWDC 2017 Session 606

Covering all details that we actually want to share/broadcast or capture our iOS device screen with audio & videos.

Apple Introduce ReplyKit2 for screen capturing & sharing.

Code For Broadcasting:

1. Create Object of RPScreenRecorder:

`let broadCastController = RPBroadcastController()`

`let recorder = RPScreenRecorder.shared()`

2. Use startBroadcasting() method to start broadcasting:

    func startBroadcasting() {
            RPBroadcastActivityViewController.load { broadcastAVC, error in
                guard error == nil else {
                    print("Cannot load Broadcast Activity View Controller.")
                    return
                }
    
                if let broadcastAVC = broadcastAVC {
                    broadcastAVC.delegate = self
                    self.present(broadcastAVC, animated: true, completion: nil)
                }
            }
      }

3. Use below activity Controller method to choose your app to broadcast.

func broadcastActivityViewController(_ broadcastActivityViewController: RPBroadcastActivityViewController,
                                         didFinishWith broadcastController: RPBroadcastController?,
                                         error: Error?) {
        guard error == nil else {
            print("Broadcast Activity Controller is not available.")
            return
        }
        
        broadcastActivityViewController.dismiss(animated: true) {
            broadcastController?.startBroadcast { error in
                //TODO: Broadcast might take a few seconds to load up. I recommend that you add an activity indicator or something similar to show the user that it is loading.
                if error == nil {
                    print("Broadcast started successfully!")
                    self.broadcastStarted()
                }
            }
        }
    }

4. Use stopBroadcasting() method to Stop Broadcasting:

func stopBroadcasting() {
        broadCastController.finishBroadcast { error in
            if error == nil {
                print("Broadcast ended")
                self.broadcastEnded()
            }
        }
}

Hope this latest update will help!

Will update more soon...

like image 165
CodeChanger Avatar answered Jan 02 '23 16:01

CodeChanger