Log in or register to post comments

Need help on Integrating Cloud Recognition and VideoPlayback

July 27, 2015 - 8:07am #1

Hi,

I wanted to create an app which will play video from URL on recognition of an Image Target which is in Cloud. I imported the Cloud Recognition Prefab and VideoPlayback Prefab into the project.

I created the ImageTarget and add the Video under it. I have also modified the onSearchResult Method in CloudRecoEventHandler to play the video. Following is the code which I modified:

1
2
3
4
5
6
7
8
9
10
var dict = targetSearchResult.MetaData;
     VideoPlaybackBehaviour video = ImageTargetTemplate.gameObject.GetComponentInChildren<VideoPlaybackBehaviour>();
     if(video != null)
     {
         video.VideoPlayer.Unload();
         if(video.VideoPlayer.Load(dict, VideoPlayerHelper.MediaType.ON_TEXTURE, false, 0) == false)
         {
             video.VideoPlayer.Play(false, video.VideoPlayer.GetCurrentPosition());
         }
     }
I was able to fetch the metadata on successful but the video is not getting played. I'm getting this error when I scan the image: 
 
AndroidJavaException: java.lang.NullPointerException: Attempt to invoke virtual method 'void java.util.concurrent.locks.ReentrantLock.lock()' on a null object reference
at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <filename unknown>:0
....
at VideoPlayerHelper.videoPlayerUnload () [0x00000] in /Users/thirunar/unityvuforiaplayback/Assets/Vuforia Video Playback/Scripts/VideoPlayerHelper.cs:347
at VideoPlayerHelper.Unload () [0x00000] in /Users/thirunar/unityvuforiaplayback/Assets/Vuforia Video Playback/Scripts/VideoPlayerHelper.cs:130
at CloudRecoEventHandler.OnNewSearchResult (TargetSea
 

 

Need help on Integrating Cloud Recognition and VideoPlayback

July 11, 2016 - 11:12pm #2

Hello.

Have you made some advance with this trouble?
I'm making the same thing (cloud + video) and I'm facing the same problem.

I/Unity   ( 3129): **** TARGET METADATA  : 1|1|1
I/Unity   ( 3129):
I/Unity   ( 3129): (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37)
I/Unity   ( 3129):
I/Unity   ( 3129): AndroidJavaException: java.lang.NullPointerException: Attemptto invoke virtual method 'void java.util.concurrent.locks.ReentrantLock.lock()'on a null object reference
I/Unity   ( 3129): java.lang.NullPointerException: Attempt to invoke virtual method 'void java.util.concurrent.locks.ReentrantLock.lock()' on a null object reference
I/Unity   ( 3129):      at com.qualcomm.VuforiaMedia.VideoPlayerHelper.unload(VideoPlayerHelper.java:343)
I/Unity   ( 3129):      at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
I/Unity   ( 3129):      at com.unity3d.player.UnityPlayer.a(Unknown Source)
I/Unity   ( 3129):      at com.unity3d.player.UnityPlayer$b.run(Unknown Source)
I/Unity   ( 3129):   at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <filename unknown>:0
I/Unity   ( 3129):   at UnityEngine.AndroidJNISafe.CallBooleanMethod (IntPtr obj, IntPtr methodID, UnityEngine.jvalue[] args) [0x00000] in <filename unknown>:0I/Unity   (3129):   at UnityEngine.AndroidJavaObject._Call[Boolean] (System.String methodName, System.Object[] args) [0x00000] in <filename unknown>:0
I/Unity   ( 3129):   at UnityEngine.AndroidJavaObject.Call[Boolean] (System.String methodName, System.Object[

Thanks.

Log in or register to post comments