screen_capture 1.0.1 screen_capture: ^1.0.1 copied to clipboard
A Flutter plugin for screen recording on macOS and iOS, supporting system audio.
screen_capture #
A Flutter plugin for macOS and IOS to record the screen and capture system audio, designed for seamless integration in Flutter applications. This plugin currently supports screen recording on macOS and IOS only.
Features #
- Screen recording functionality on macOS and IOS
- System audio recording (not microphone)
- Customizable recording settings
- Simple API for starting and stopping recordings
Installation #
Add screen_capture
as a dependency in your pubspec.yaml
file:
dependencies:
screen_capture:
path: path/to/your/plugin
Or install from GitHub (if you’re planning to publish it):
dependencies:
screen_capture:
git:
url: https://github.com/TheBilalJaved/screen_capture.git
Then, run:
flutter pub get
Usage #
-
Import the Plugin
In your Dart code, import thescreen_capture
package:import 'package:screen_capture/screen_capture.dart';
-
Start and Stop Recording
UsestartRecording
andstopRecording
methods to manage recording sessions.// Start recording await FlutterScreenCapture.startRecording(); // Stop recording await FlutterScreenCapture.stopRecording();
-
Save and Play Recordings
Save the recordings to a local file and use a media player to review the results.
Permissions #
Ensure your macOS application has the necessary permissions:
- Open
macos/Runner/Info.plist
. - Add the following keys to request screen recording permission:
<key>NSCameraUsageDescription</key>
<string>We need access to record the screen.</string>
<key>NSMicrophoneUsageDescription</key>
<string>We need access to capture system audio during screen recording.</string>
Notes #
- This plugin is currently macOS and IOS only.
- The plugin captures system audio only, not microphone input.
- Audio is captured through an
AVAudioEngine
, which can be customized further if needed.
License #
MIT License. See LICENSE file for details.