Start a new topic

CouldRecognition tracker. I can hear video playing but I do not see it.

CouldRecognition tracker. I can hear video playing but I do not see it.


Hello! 

I am on my way to switch to a CouldRecognition tracker and for some reason my video drawables do not work properly. When target image is recognized I can hear video playing but I do not see it. I start seeing video only when I take camera view away from the tarket image and then take it back on it. But I need to to show up as soon as video is loaded and starts playing. 

Below is my simplified code with short comments: 

//Works!
WorldTracker.recognize(onRecognition, onRecognitionError); 

//Works well!
function onRecognition(recognized, response) {
  createARObject(response);
}

 
function createARObject(responseObj)
 {
  var metadata = JSON.parse(responseObj.metadata); 
  var myco_inner2 = new AR.Trackable2DObject(WorldTracker, metadata.image_name, {});

   var myvideo_inner = new AR.VideoDrawable(metadata.video_url, 1, {

                                                 offsetX: 0,

                                                 onLoaded: function videoLoaded() {

                                                     alert("Video is loaded " + metadata.video_url );  // Works well!

                                                     myvideo_inner.play(1);

                                                  } 

                                                }

                                                );

  myco_inner2.drawables.addCamDrawable(myvideo_inner);

}

I get an alert message that video is loaded. Then I start hearing video sound but the video itself does not appear. I have also tried creating video drawable this way but the result is the same:

function createARObject(responseObj)
 {
  var metadata = JSON.parse(responseObj.metadata); 
   var myvideo_inner = new AR.VideoDrawable(metadata.video_url, 1, {
             offsetX: 0,
             onLoaded: function videoLoaded() {
             alert("Video is loaded " + metadata.video_url );  // Works well!
             myvideo_inner.play(1);

                                                  } 
    }
);

 


  var myTrackable = new AR.Trackable2DObject(WorldTracker, metadata.image_name, {
drawables: {
cam: myvideo_inner
}
});


 

}

Video shows up only after I take the camera view away from Target image and then back on it. But I need it to show up as soon as Video is loaded and starts playing. 

Did you experience this problem before? Please advise me how to fix it. 

Thank you!

 

 

 

 

 

 

Hi Sergey,
can you send us a project which demonstrates the issue so that we can have a look at it? Simply send it to ios-sdk@wikitude.com.

Best regards

Andreas

Andreas, thank you very much for your message! 

I have just sent you a zip archive with the sample iOS project and a target image to scan. Please let me know as soon as you get a chance to check it. Even though I do not have issues displaying video drawables with a previouse SDK(on device recognition) I still hope it is something that I need to do differently with the new sdk and once you tell me what it is I can quickly correct and move on. 

Thank you Andreas and I am waiting for your soon reply. 

Sergey

Hi Andreas! 

Thank you very much for your message! 

Yes, removing the Alert messages did the trick.Your advise helped me to resolve the issue. I used alert message to see and make sure that image is recognized and the video is loaded and because business logic(even when the alert messge is displayed and then dismissed) would still execute I could not assume it affects the video.... It works now. Thank you Andreas! 

I wish you a very good day!

Sergey

 

 

 

Hi Sergey,
Removing the alert is only a temporary workaround. I found the underlying problem and will fix this in the next Developer Channel release since you can continue working with the mentioned quick fix. 

Best regards

Andreas
Login or Signup to post a comment