Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
aguirreduran's avatar
aguirreduran
Explorer
4 years ago

Video recorder with an in-Game button. Androind MediaRecorder error

Hello,

currently I'm working on a project that needs to record what the user is observing in the Oculus Quest 2. The recording should be triggered by an UI button that the user can use whenever it wants. 


I didn't find any dedicated asset for this purpose, but I found a solution for Android, in particular a screen recorder. It's a simple asset that i tested in my smathphone at it's working well (record the screen using a button from the UI, and save it to the gallery).

 

The asset can be found here:

 https://github.com/thanh-nguyen-kim/Unity_Android_Screen_Recorder

The guide can be found here:

https://killertee.wordpress.com/2018/01/08/unity-android-record-game-screen-with-audio-using-your-ad-hoc-plug-in/


After importing this asset in my project in order to test this "screen recorder" with the Oculus, the application crashes provably with the error:
E Unity :  AndroidJavaException: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.media.MediaRecorder.start()' on a null object reference
E Unity : java.lang.NullPointerException: Attempt to invoke virtual method 'void android.media.MediaRecorder.start()' on a null object reference

 

Any advice to proceed?
 

Replies have been turned off for this discussion