bmcreations / scrcast Goto Github PK
View Code? Open in Web Editor NEWDrop-in Android Screen Recording Library
Home Page: https://bmcreations.github.io/scrcast/
License: Apache License 2.0
Drop-in Android Screen Recording Library
Home Page: https://bmcreations.github.io/scrcast/
License: Apache License 2.0
I have setup the recorder like so:
recorder = ScrCast.use(this);
recorder.updateOptions(GetDefaultOptions());
and the GetDefaultOptions() function is defined as follows:
private static Options GetDefaultOptions() {
return new Options(
new VideoConfig(),
new StorageConfig("somedir", Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)),
new NotificationConfig(),
false,
0,
true
);
}
I was assuming that updateOptions function would do the needful but when I inspect the recorder object in the debugger, the outputDirectory for the recorder seems to be different from that of the options object of the recorder.
How am I supposed to change the directory where the video is saved.
Describe the bug
When I record the screen using the sample app, the recorded video is saved in a directory named "scrcast".
Expected behavior
The video should be saved in a directory named "scrcast-sample".
To Reproduce
Just use the sample app to record the screen.
Version
Library version 0.3.0
Device: Samsung Galaxy S9+ running Android 10 (API level 29)
Describe the bug
I cannot install library using gradle. After adding implementation "org.jetbrains.kotlin:kotlin-reflect:1.6.21"
to dependencies in build.gradle
and running build I am getting following error:
> Could not resolve dev.bmcreations:scrcast:0.3.0.
Required by:
project :xyz-kotlin
> No matching variant of dev.bmcreations:scrcast:0.3.0 was found. The consumer was configured to find a runtime of a component, preferably only the resources files but:
- Variant 'releaseApiPublication' capability dev.bmcreations:scrcast:0.3.0:
- Incompatible because this component declares an API of a component, with the library elements 'aar' and the consumer needed a runtime of a component, preferably only the resources files
- Variant 'releaseRuntimePublication' capability dev.bmcreations:scrcast:0.3.0 declares a runtime of a component:
- Incompatible because this component declares a component, with the library elements 'aar' and the consumer needed a component, preferably only the resources files
the same happens for version 0.2.0
Expected behavior
build ends wiht success
To Reproduce
Add implementation "org.jetbrains.kotlin:kotlin-reflect:1.6.21"
to dependencies in build.gradle
and run a build
Logs/Screenshots
If applicable, add logs or screenshots to help explain your problem.
Version
Library version: 0.3.0, 0.2.0
Ubuntu 20:04
java openjdk version "17.0.5" 2022-10-18
kotlin
Allow view observers to bind to scrcast for current state and not force receivers to handle lifecycle bounds (e.g callback when app isn't in foreground - just don't emit when not active). Replayable (last state) will allow observers to update any UI elements derived from our state (is recording, is idle, is in start delay, is paused)
Resume on screen on?
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.
No
Describe the solution you'd like
A clear and concise description of what you want to happen.
UX improvement to the default notification to be closer to what Android 11's implementation proposes.
Additional context
Add any other context or screenshots about the feature request here.
video, audio, storage
Describe the bug
setAudioSource(MediaRecorder.AudioSource.MIC)
setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB)
when i add these lines in createrecorder method .i am unable to record audio and recording screen.please fix issue or guide me how can i enable audio when screen recording..please anyone help me
Expected behavior
A clear and concise description of what you expected to happen.
To Reproduce
How can we reproduce this?
Logs/Screenshots
If applicable, add logs or screenshots to help explain your problem.
Version
What library version are you using? Also does this occur on a specific API level or Android device.
only 0.2.0 available according to https://search.maven.org/search?q=scrcast
this messege appear in the build log:
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/github/bmc08gt/activity-results-dispatcher/master-SNAPSHOT/maven-metadata.xml
- https://dl.google.com/dl/android/maven2/com/github/bmc08gt/activity-results-dispatcher/master-SNAPSHOT/activity-results-dispatcher-master-SNAPSHOT.pom
- https://dl.google.com/dl/android/maven2/com/github/bmc08gt/activity-results-dispatcher/master-SNAPSHOT/activity-results-dispatcher-master-SNAPSHOT.jar
- https://jcenter.bintray.com/com/github/bmc08gt/activity-results-dispatcher/master-SNAPSHOT/maven-metadata.xml
- https://jcenter.bintray.com/com/github/bmc08gt/activity-results-dispatcher/master-SNAPSHOT/activity-results-dispatcher-master-SNAPSHOT.pom
- https://jcenter.bintray.com/com/github/bmc08gt/activity-results-dispatcher/master-SNAPSHOT/activity-results-dispatcher-master-SNAPSHOT.jar
- https://maven.google.com/com/github/bmc08gt/activity-results-dispatcher/master-SNAPSHOT/maven-metadata.xml
- https://maven.google.com/com/github/bmc08gt/activity-results-dispatcher/master-SNAPSHOT/activity-results-dispatcher-master-SNAPSHOT.pom
- https://maven.google.com/com/github/bmc08gt/activity-results-dispatcher/master-SNAPSHOT/activity-results-dispatcher-master-SNAPSHOT.jar
Required by:
project :app > dev.bmcreations:scrcast:0.2.0
the build gradle file:
repositories {
jcenter()
google()
mavenCentral()
}
Bug
I set the directory, directoryName, and fileNameFormatter I want in the object options. The fileNameFormatter specified is used, but the video is not saved to the correct directory.
Expected behaviour
The video saves to the specified directory.
Logs/Screenshots
First line is the storage directory specified (recorder.options.storage.mediaStorageLocation immediately after applying options to recorder).
Second line is the path to which the video file is actually saved (file.absolutePath in onRecordingFinished callback).
Version
v0.3.0
Note
I'm relatively new to Android development, so it may be a simple mistake in my code rather than a bug.
The file of recording is not being saved on Android Q+ (I think the library doesn't have a Scoped storage support)
Icon, title, description, (actions?)
In the event client apps want to handle the stateful-ness of their notification and the content in it's entirety, let's provide an easy (?) way to request the notification from client app for display.
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.
No
Describe the solution you'd like
A clear and concise description of what you want to happen.
The ability to capture a specific frame during an ongoing recording to focus in on something could prove useful for certain usecases (e.g QA use)
Additional context
Add any other context or screenshots about the feature request here.
Bug
MediaRecorder crashes in Android 12 emulator on "prepare" call.
Logs
E/MediaRecorder: prepare failed: -2147483648
E/AndroidRuntime: FATAL EXCEPTION: main
Process: dev.bmcreations.scrcast.app, PID: 9916
java.io.IOException: prepare failed.
at android.media.MediaRecorder._prepare(Native Method)
at android.media.MediaRecorder.prepare(MediaRecorder.java:1296)
at dev.bmcreations.scrcast.internal.recorder.service.RecorderService.createRecorder(RecorderService.kt:159)
at dev.bmcreations.scrcast.internal.recorder.service.RecorderService.access$createRecorder(RecorderService.kt:32)
at dev.bmcreations.scrcast.internal.recorder.service.RecorderService$recordInternal$1.invokeSuspend(RecorderService.kt:227)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7839)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
Describe the bug
When recording screen and app is in land scape mode it still records as Portrait and shows small landscape recording in between.
Expected behavior
When app is in landscape it should record screen as landscape with full screen width and height and save video with full resolution. it should save Lanscape recording into full screen width and height with correct orientation.
To Reproduce
How can we reproduce this?
I am using this capacitor plugin for my Ionic app:
https://github.com/Cap-go/capacitor-screen-recorder
Test Repo: https://github.com/Saqib92/capacitor-screen-recording
Suppose I want to capture only what's on my app, is this still the only solution that I can use, using the special permission?
Or is there a better one?
And what if I want to capture what's on my app, but including when it shows the OS background (static or live wallpaper) behind ?
Describe the bug
It is a runtime exception when attempted to create instance of ScrCast about lifecycle.
java.lang.IllegalStateException: LifecycleOwner y@d1a71e8 is attempting to register while current state is RESUMED. LifecycleOwners must call register before they are STARTED.
Expected behavior
Expected creation of ScrCast and later start recording.
To Reproduce
Try to create instance of class in fragment (no matter onCreate, onActivityCreated, onViewCreate)
E/AndroidRuntime: FATAL EXCEPTION: main
Process: kz.nurbank.app.dev, PID: 32114
java.lang.IllegalStateException: LifecycleOwner kz.crystalspring.ib_for_individuals.ui.activities.client_restrictions.ClientRestrictionsActivity@d1a71e8 is attempting to register while current state is RESUMED. LifecycleOwners must call register before they are STARTED.
at androidx.activity.result.ActivityResultRegistry.register(ActivityResultRegistry.java:123)
at androidx.activity.ComponentActivity.registerForActivityResult(ComponentActivity.java:659)
at androidx.activity.ComponentActivity.registerForActivityResult(ComponentActivity.java:668)
at dev.bmcreations.scrcast.ScrCast.(ScrCast.kt:166)
at dev.bmcreations.scrcast.ScrCast.(ScrCast.kt:42)
at dev.bmcreations.scrcast.ScrCast$Companion.use(ScrCast.kt:375)
at kz.crystalspring.ib_for_individuals.ui.accounts.accounts_binding.form.photo.face.ContactOperationFaceFragment.onCreate(ContactOperationFaceFragment.kt:86)
at androidx.fragment.app.Fragment.performCreate(Fragment.java:2949)
at androidx.fragment.app.FragmentStateManager.create(FragmentStateManager.java:475)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:278)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2189)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2106)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2002)
at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:524)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:236)
at android.app.ActivityThread.main(ActivityThread.java:8061)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
Version
minSdk: 23
targetSdk: 30
libraryVersion: 0.3.0
Is your feature request related to a problem? Please describe.
Allow end users to only allow recording to occur on their own app processes - auto pausing when their app is backgrounded.
Describe the solution you'd like
Add configuration option to auto-pause when scrcast detects that the client app process is transitioning to the background.
Additional context
#50
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.