replay_kit_launcher: ^0.3.0 copied to clipboard
A flutter plugin of the launcher used to open RPSystemBroadcastPickerView for iOS
ReplayKit Launcher #
A flutter plugin of the launcher used to open
RPSystemBroadcastPickerView for iOS
Note: Only support iOS
Related projects #
Shared preferences with App Group: Shared preference supporting iOS App Group capability (using
If you need to implement screen capture on Android, I have also developed a helpful plugin:
MediaProjection Creator: A flutter plugin of the creator used to create
MediaProjection instance (with requesting permission) for Android
To use this plugin, add
replay_kit_launcher as a dependency in your pubspec.yaml file.
/// Please fill in the name of the Broadcast Extension in your project, which is the file name of the `.appex` product /// [extensionName] is your `BroadCast Upload Extension` target's `Product Name`, /// or to be precise, the file name of the `.appex` product of the extension ReplayKitLauncher.launchReplayKitBroadcast('BroadcastDemoExtension');
Before using this method, you need to write some native code in the iOS native project to cooperate with it. For details, please refer to
// Please fill in the CFNotification name in your iOS native project ReplayKitLauncher.finishReplayKitBroadcast('ZGFinishBroadcastUploadExtensionProcessNotification');
Please see the example app of this plugin for a full example.
Another practical demo #
This demo implements screen live broadcast on iOS/Android by using the ZEGO Express Audio and Video Flutter SDK
What is the
Open your flutter project's iOS native workspace (
Targetand create a new
Broadcast Upload Extensiontarget.
Nextand then fill in the
Product Namefield. This field is the file name of the
How to stop the ReplayKit broadcast process after launching?
There are two ways to stop the ReplayKit broadcast process, one is to actively click the red button at the top of the iPhone screen, and the other is to call the
-[RPBroadcastSampleHandler finishBroadcastWithError:]method provided by ReplayKit broadcast sub-process's
But the question is how to invoke the method of the Replaykit sub-process's object on flutter side?
One solution is to use cross-process notifications
CFNotificationCenterGetDarwinNotifyCenter, post notifications on the flutter side with
Method Channel, receive notifications on the iOS Replaykit sub-process side, and then actively invoke the
finishBroadcastWithError:method after receiving the notification.
The flutter plugin's
ReplayKitLauncher.finishReplayKitBroadcast()method does this job: it uses
Method Channelon the flutter side to notify the iOS native main process side to post cross-process notifications, the param
notificationNameis the CFNotification name.
So you need to refer to the
/example/ios/BroadcastDemoExtension/ZGBroadcastManager.mfile to implement code on your project's
iOS ReplayKit broadcast extension sub-process sideto receive notifications and invoke
finishBroadcastWithError:method to stop the ReplayKit broadcast sub-process extension.
Everyone is welcome to contribute code via pull requests, to help people asking for help, to add to our documentation, or to help out in any other way.