Last active
October 13, 2016 07:50
-
-
Save Oleur/c8fab90f0a0c02b96035c33e2649b25a to your computer and use it in GitHub Desktop.
JNI Call from Unity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Can't use AndroidJavaObject.Call() with a jobject, must use low level interface | |
IntPtr setSimplePlayerID = AndroidJNI.GetMethodID(localMediaPlayer.GetRawClass(), "setSurface", "(Landroid/view/Surface;)V"); | |
jvalue[] parms = new jvalue[1]; | |
parms[0] = new jvalue(); | |
parms[0].l = _androidSurface; // Android Surface reference as an IntPtr | |
AndroidJNI.CallVoidMethod(localMediaPlayer.GetRawObject(), setSimplePlayerID, parms); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment