Unfortunately, this isn't going to happen until render to texture functionality is added to the API. Currently there is no direct access to the raw texture data so although it is possible to decompress video to a buffer in memory, there is currently no way to apply that memory to a texture for it to be drawn.
Render to texture is something that a couple of developers have been very vocal on and as such it will probably become a reality in a later release but nobody knows when.
The problem is that you don't have access to the Gideros display heirarchy from within a plugin. The best you could do is have a play window (which you could position, scale, resize etc) which would reside on top of the current display much like the way the UIKit plugin for iOS works.
WhiteTree Games - Home, home on the web, where the bits and bytes they do play! #MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
That should work, maybe with a user plugin to jump between Gideros and Java to add / remove the VideoView from the display hierarchy as and when required.
Do share how it works out for you I have been smashing my face on my keyboard over the calling Native Commands thing for a while playing with it.
If I get a chance I was going to try and put together an example of Android Plugin Programming, since iOS seems to be getting most of the love at the moment--like droid more myself, currently my interest is in kiip.me working but I am guessing the JavaVM could be used for all sorts of things
I got the audio played but no video. I suspect this issue is related with Giredos' renderer. So, I have mGLView removed before add VideoView to the layout. This trick fix the issue.
It works fine before but it doesn't work recently . The player is crash whenever I call video.play().
07-04 14:27:57.969: E/AndroidRuntime(22257): FATAL EXCEPTION: GLThread 14
07-04 14:27:57.969: E/AndroidRuntime(22257): java.lang.CloneNotSupportedException: Class doesn't implement Cloneable
07-04 14:27:57.969: E/AndroidRuntime(22257): at java.lang.Object.clone(Object.java:155)
07-04 14:27:57.969: E/AndroidRuntime(22257): at com.giderosmobile.android.player.JavaNativeBridge.nativeDrawFrame(Native Method)
07-04 14:27:57.969: E/AndroidRuntime(22257): at com.giderosmobile.android.player.JavaNativeBridge.onDrawFrame(JavaNativeBridge.java:341)
07-04 14:27:57.969: E/AndroidRuntime(22257): at com.giderosmobile.android.GiderosRenderer.onDrawFrame(PlayerActivity.java:211)
07-04 14:27:57.969: E/AndroidRuntime(22257): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1388)
07-04 14:27:57.969: E/AndroidRuntime(22257): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1138)
@zaniar I found the issue I believe, apparently after android 2.3 came out, you MUST pair GetStaticObjectMethod() with CallStaticObjectMethod() or the system will flip out and throw this error.
You need to update line number 32 in video.cpp to the following and it should work:
(*env).CallStaticObjectMethod(cls, method);
I was able to use this information to get my plugin working as well, hopefully this helps you with yours as well. Let me know if I can help any other way
Comments
Render to texture is something that a couple of developers have been very vocal on and as such it will probably become a reality in a later release but nobody knows when.
Website: http://www.castlegateinteractive.com
https://play.google.com/store/apps/developer?id=Castlegate+Interactive
#MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
l guess the ideal implementation is not possible for now..
I think I can use Android VideoView just like this tutorial (http://appcodingeasy.com/Gideros-Mobile/Gideros-Implementing-AdMob-for-Android)
Wish me luck..
Website: http://www.castlegateinteractive.com
https://play.google.com/store/apps/developer?id=Castlegate+Interactive
I have successfuly play a video on gideros player using VideoView
The next problem is:
How to get JNIEnv in my plugin code?
As far as I know, I need JNIEnv to call Java method from C/C++
You may find this discussion interesting as it does mention how to get a hold of the JavaVM--and thus in turn call native functions from the plugin.
http://www.giderosmobile.com/forum/discussion/comment/6793#Comment_6793
Do lets us know how it works for you
If I get a chance I was going to try and put together an example of Android Plugin Programming, since iOS seems to be getting most of the love at the moment--like droid more myself, currently my interest is in kiip.me working but I am guessing the JavaVM could be used for all sorts of things
https://dl.dropbox.com/u/19074677/Gideros/VideoPlugin.zip
Make sure you change the value of LOCAL_SRC_FILES in Android.mk to match your environment
https://dl.dropbox.com/u/19074677/Gideros/Player_EclipseProject.zip
to show the video use..
I got the audio played but no video. I suspect this issue is related with Giredos' renderer. So, I have mGLView removed before add VideoView to the layout. This trick fix the issue.
It works fine before but it doesn't work recently . The player is crash whenever I call video.play().
You need to update line number 32 in video.cpp to the following and it should work:
Notes: (I found out the issue isn't new some other people have been running into it as well, here is a guy that posted the answer: https://groups.google.com/group/android-ndk/tree/browse_frm/thread/71ac843f9ec586c7/f308bfcc23c10645?_done=/group/android-ndk/browse_frm/thread/71ac843f9ec586c7/f308bfcc23c10645?tvc=1&&tvc=1&pli=1)
@omer
I think you can