Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bmcreations/scrcast
Drop-in Android Screen Recording Library
https://github.com/bmcreations/scrcast
android android-library androidx coroutines kotlin mediarecorder recording screencapture screencast
Last synced: about 1 month ago
JSON representation
Drop-in Android Screen Recording Library
- Host: GitHub
- URL: https://github.com/bmcreations/scrcast
- Owner: bmcreations
- License: apache-2.0
- Created: 2020-05-13T15:41:39.000Z (over 4 years ago)
- Default Branch: trunk
- Last Pushed: 2023-06-26T02:36:29.000Z (over 1 year ago)
- Last Synced: 2024-07-11T14:45:25.815Z (5 months ago)
- Topics: android, android-library, androidx, coroutines, kotlin, mediarecorder, recording, screencapture, screencast
- Language: Kotlin
- Homepage: https://bmcreations.github.io/scrcast/
- Size: 1.6 MB
- Stars: 212
- Watchers: 5
- Forks: 26
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-list - bmcreations/scrcast - Drop-in Android Screen Recording Library (Kotlin)
README
![scrcast](readme-header.png)
![Android CI](https://github.com/bmcreations/scrcast/workflows/Android%20CI/badge.svg)
![Latest Release](https://img.shields.io/github/v/release/bmcreations/scrcast)A fully, featured replacement for screen recording needs backed by Kotlin with the power of Coroutines and Android Jetpack. scrcast is:
* Easy to use: scrcast's API leverages Kotlin languages features for simplicity, ease of use, and little-to-no boilerplate. Simply configure and `record()`
* Modern: scrcast is Kotlin-first and uses modern libraries including Coroutines and Android Jetpack.## Download
scrcast is available on `mavenCentral()`.
`implementation ("dev.bmcreations:scrcast:$version")`
## Quick Start
scrcast provides a variety of configuration options for capturing, storing, and providing user interactions with your screen recordings.
### Configuring
```kotlin
val recorder = ScrCast.use(activity)
recorder.apply {
// configure options via DSL
options {
video {
maxLengthSecs = 360
}
storage {
directoryName = "scrcast-sample"
}
notification {
title = "Super cool library"
description = "shh session in progress"
icon = resources.getDrawable(R.drawable.ic_camcorder, null).toBitmap()
channel {
id = "1337"
name = "Recording Service"
}
showStop = true
showPause = true
showTimer = true
}
moveTaskToBack = false
startDelayMs = 5_000
}
}
```You can find [full configuration details and documentation here](https://bmcreations.github.io/scrcast/).
### State
interaction with `MediaRecorder`is abstracted in a easy to use and manage interface, via explict state-changing accessors.
#### Start
```kotlin
recorder.record()
```#### Stop
```kotlin
recorder.stopRecording()
```#### Pause
```kotlin
recorder.pause()
```#### Resume
```kotlin
recorder.resume()
```### Callbacks
State changes are emitted via `RecordingCallbacks` as a single interface or via a discrete lambda `onRecordingStateChange`
Completed recording output file is also emittable in `RecordingCallbacks` via
```kotlin
fun onRecordingFinished(file: File)
```## Requirements
* AndroidX
* `minSdkVersion` 23+
* `compileSdkVersion` 28+
* Java 8+Gradle (`.gradle`)
```kotlin
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "1.8"
}
}
```Gradle Kotlin DSL (`.gradle.kts`)
```kotlin
android {
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}tasks.withType {
kotlinOptions {
jvmTarget = "1.8"
}
}
```## License
```text
Copyright 2020 bmcreationsLicensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttps://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```