By coolhawk
on Wed, 06/20/2012 - 17:11
Hi,I want to use the Android widget "VideoView" to play a Video on the Target,
I found someone like me ask the question [HTML]https://ar.qualcomm.at/arforums/showthread.php?t=1096[/HTML]
but i found he use the Intent to another activity to play the vedio. And i want to play it on the current activity ImageTargets.java.
Here is my code snippet :
First:
ImageTargets.cpp
[CODE]
// call it with the trackable's name
if (trackable->getId() != lastTrackableId) {
jstring js = env->NewStringUTF(trackable->getName());
jclass javaClass = env->GetObjectClass(obj);
jmethodID method = env->GetMethodID(javaClass, "VideoPlay", "(Ljava/lang/String;)V");
env->CallVoidMethod(obj, method, js);
lastTrackableId = trackable->getId();
}
[/CODE]
Second:
ImageTargetsRenderer.java
I make a little change:
public class ImageTargetsRenderer [COLOR=Red]extends Activity[/COLOR] implements GLSurfaceView.Renderer
{
......
Here is my VideoPlayCode
public void VideoPlay()
{
VideoView videoView = (VideoView)findViewById(R.id.videoView);
videoView.setVideoPath("/sdcard/Channel2.mp4");
MediaController mc = new MediaController(this);
videoView.setMediaController(mc);
videoView.requestFocus();
videoView.start();
}
}
Third
How should I call the VideoPlay() function ?
protected void onResume()
{
super.onResume();
..............
}
Please help me ...
Regards
Re: play native video on the ImageTarget like "stone"
Re: play native video on the ImageTarget like "stone"
Re: play native video on the ImageTarget like "stone"