Android screen record helper, Android 屏幕录制

ScreenRecordHelper

项目地址:nanchen2251/ScreenRecordHelper 

简介: ?Android screen record helper, Android 屏幕录制https://github.com/nanchen2251/ScreenRecordHelper

更多:作者   提 Bug   

标签:

 

?screen record helper https://github.com/nanchen2251/ScreenRecordHelper

中文使用说明

 

 

feature

  1. screen record
  2. audio record
  3. support stripping environment volume
  4. support saving to album
  5. support for custom duration
  6. support for custom path and name
  7. resist the test of DAU 1 million users

    Screenshots

How to use it

Step 1. Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Step 2. Add the dependency

dependencies {
    implementation 'com.github.nanchen2251:ScreenRecordHelper:1.0.2'
}

Step 3. Just use it in your project

// start screen record
if (screenRecordHelper == null) {
    screenRecordHelper = ScreenRecordHelper(this, null, PathUtils.getExternalStoragePath() + "/nanchen")
}
screenRecordHelper?.apply {
    if (!isRecording) {
        // if you want to record the audio,you can set the recordAudio as true
        screenRecordHelper?.startRecord()
    }
}

// You must rewrite the onActivityResult
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
    super.onActivityResult(requestCode, resultCode, data)
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && data != null) {
        screenRecordHelper?.onActivityResult(requestCode, resultCode, data)
    }
}

// just stop screen record
screenRecordHelper?.apply {
    if (isRecording) {
        stopRecord()     
    }
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值