Start a new topic

creating drawables inside onEnterFieldOfVision (lazy loading) videoDrawable

creating drawables inside onEnterFieldOfVision (lazy loading) videoDrawable


Hi, I saw this post here at the forum in which show the code to so lazy loading of images resources and drawables. Very nice but I couldn't figure out how to do it for videoDrawables. I understand, as I have multiple video targets, creating the drawable from inside the onDnterOfFieldFoVision function would be faster because you wouldn't need to load all the videos unnecesseraly

https://support.wikitude.com/support/search/topics?term=Load+tracker+duration

 

Regards:

 

Axel

Hi Axel,


The concept of "lazy loading for AR.VideoDrawables" is quite similar.
Use onEnterFieldOfVision of AR.Trackable2dObject to receive a notification when the target was scanned.
You can then use add- and removeCamDrawable to modify the augmentations being displayed/created.
I recommend you to implement a basic caching algorithm so you e.g. destroy old videoDrawables only when entering FoV of a new target. That way you can reuse exising assets in case user scans the very same target twice (e.g. because target was lost unintentionally)

Best regards,
Andreas

 

Note that the post you are refering to is from 2o12 using an outdated version of our tracker.
Login or Signup to post a comment