screen_record_flutter 0.0.1
screen_record_flutter: ^0.0.1 copied to clipboard
Flutter plugin to record the screen for user analytics.
screen_record_flutter #
Flutter plugin to record the screen for user analytics.
- Getting Started
- Installation
- Requirements
- Usage
Getting Started #
Installation #
Add this to dependencies in your pubspec.yaml file.
screen_record_flutter: ^0.0.1
Requirements #
-
Add the following in the manifest
Usage: #
Import package,
import ‘package: screen_record_flutter/screen_record_flutter.dart’
-
To start the record :
void startRecording() async { final dir = '${(await _getSavedDir())}'; await Directory(dir).create(recursive: true); final stem = '$dir/${DateTime.now().toIso8601String().replaceAll(".", "").replaceAll(":", "")}'; pathData = '$stem.mp4'; meta = '$stem.meta'; log('RECORDED VIDEO PATH = $pathData'); await _recorder .start( pathVideo: pathData, pathMetadata: meta, ) .then((value) { log("RECORDING STARTED"); }); } -
To stop the record :
Automatically video will be saved, once we invoke this method.
void stopRecording() { _recorder.stop().then((value) { log("RECORDING STOPPED"); }); } -
To record a particular widget :
Wrap that widget with
ScreenRecordWidget, then we can call the invoke methods to record the videos. -
To play the videos inside the app :
ScreenRecordPlayerWidget. we can use this widget to play the video inside the app. -
NOTE : Once app goes background without invoke
stopmethod, videos will not be saved, to rectify the issue we can useflutter_fbbgpackage to know the state off the application. for more info refer the example tab.