flutter_screen_recording
一個用於錄製螢幕的新Flutter外掛程式。此外掛程式可用於在Android、iOS和Web裝置上錄製螢幕。
一個用於錄製螢幕的新Flutter外掛程式。
以下為英文專案原文快照,最新內容請造訪 GitHub。
Flutter plugin to record the screen on Android, iOS, and web.
Current platform support in this repository:
minSdkVersion 23iOS 11.0+Import the package:
import 'package:flutter_screen_recording/flutter_screen_recording.dart';
Start screen recording:
final bool started = await FlutterScreenRecording.startRecordScreen(
'my_recording',
titleNotification: 'Screen recording',
messageNotification: 'Recording in progress',
);
Start screen recording with microphone audio:
final bool started = await FlutterScreenRecording.startRecordScreenAndAudio(
'my_recording',
titleNotification: 'Screen recording',
messageNotification: 'Recording in progress',
);
Stop recording and get the output path or file name:
final String path = await FlutterScreenRecording.stopRecordScreen;
The Android implementation uses MediaProjection, MediaRecorder, and a foreground service.
compileSdkVersion 35The example app requests permissions with permission_handler before starting recording.
The iOS implementation uses ReplayKit and requires iOS 11.0+.
Add the usage description for microphone access if you record audio:
<key>NSMicrophoneUsageDescription</key>
<string>Save audio in video</string>
The plugin returns the local output file path. If your app later saves the file to the Photos library, also add the appropriate Photos usage description to your app.
The web implementation uses getDisplayMedia and MediaRecorder.
video/mp4 recording support; WebM is used as a fallback.mp4 or .webm)await when starting and stopping recordings