Coder Social home page Coder Social logo

zersya / flutter_screen_recording Goto Github PK

View Code? Open in Web Editor NEW

This project forked from matecija/flutter_screen_recording

0.0 0.0 0.0 669 KB

A new Flutter plugin for record the screen.

License: MIT License

Kotlin 29.96% Swift 26.44% Objective-C 1.33% Dart 27.66% Ruby 14.61%
flutter kotlin native package

flutter_screen_recording's Introduction

flutter_screen_recording

A new Flutter plugin to make a video recording of the screen. This plug-in requires Android SDK 21+ and iOS 10+

Getting Started

This plugin can be used to record the screen on Android and iOS devices. The entire screen area is captured.

  1. To start the recording
bool started = FlutterScreenRecording.startRecordScreen(videoName);

Or

bool started = FlutterScreenRecording.startRecordScreenAndAudio(videoName);

For both these methods optional parameters width and height allow the dimensions of the video to be set, and therefore also the size of the video file. The default dimensions are those of the device screen.

// Record screen at quarter size, ie file size reduced by x16
Size win = window.physicalSize / 4;     // Reduce size
int width = win.width ~/ 10 * 10;       // Round to multiple of 10
int height = win.height ~/ 10 * 10;
await FlutterScreenRecording.startRecordScreen("Title",
  width: width, height: height,
  titleNotification: "dsffad", messageNotification: "sdffd",
);
  1. To stop the recording
String path = FlutterScreenRecording.stopRecordScreen;

Android

Flutter_Screen_Recording does not request permissions necessary. You can use Permission_handler, a permissions plugin for Flutter, to query and obtain the permissions in your code.

Declare the following permissions in your manifest:

    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />

In versions of Android beginning with version 10 a foreground service is required to record the screen. flutter_screen_recording now includes the flutter foreground plugin.

iOS

You only need add the permission message on the Info.plist

<key>NSPhotoLibraryUsageDescription</key>
<string>Save video in gallery</string>
<key>NSMicrophoneUsageDescription</key>
<string>Save audio in video</string>

flutter_screen_recording's People

Contributors

mikron123 avatar salime45 avatar vvalladolidiv avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.