Going Social with ReplayKit and Game Center
This session introduces with new game center features and replayKit. For now, we ignore game center as it is less likely to use. However, ReplayKit is sure the best way to get videos of UAT testing and aid developers to fixed issues.
Quick code snippnets for using replayKit
ReplayKit
- Record Audio and Visual
- Ability to Add Voice commentary
- HD quality
- Privacy safeguard (Record screen & mic / Record Screen / disallow)
- Available in iOS 9
- For A7 cpu for up
- No Direct access of replay video (only via share sheet)
Main functional classes
RPScreenRecorder
- Start , Stop and discard recording
- Check ability to record
- Enable mic for commentary
RPScreenRecorderDelegate
- if availability changes
- if recording stops ( due to error)
RPPreviewController
- preview the recording
- edit and trim
- Share
RPPreviewControllerDelegate
- after view controller dismissal
Demobots (demo project, show other new features as well)
Fine tune the replay videos
Replay Kit may be unavailable
- Airplay in use
- TV-out in use
- Unsupported device(like iPhone 4s iPhone 5)
To solve :
- use available property to check
- disable recording UI (like button) if false
- listen
screenRecorderDidChangeAvailability
for change
Discard the recording
- previous recording will be discarded when new recording is started
- Only one recording at a time
discardRecodingWithHandler
to run anything when the recording discards.
Show UI when the recording is ongoing- like a mic and REC icon
use recording
propery and microphoneEnabled
to check if the RPScreenRecorder
recording has these.
Excluding UI
- hide elements that are uninteresting
- only record main window (like recording/ virtual control / pause and menu buttons etc.)
- use sepearate for those recording UI elements
When to record
- App Control(embed the recording in logic)
- User controller(user hit the recording button)