Start a new topic

AR.VideoDrawable and missing isLoaded() method

AR.VideoDrawable and missing isLoaded() method


Thanks for reaching out to us. We left it out intentional for internal reasons but I can see that it is useful for certain tasks.

I'll put it up for internal discussion and we might add it to the API in a later version.

Hello,

 

I found out that AR.VideoDrawable class is missing isLoaded() method. What is the reason? Is that a bug or a feature?
I wanted to check when my video drawable object is ready to be display in order to hide loader image from screen.

 

My workaround for this method is to define isLoaded() function on my own:

if(typeof AR.VideoDrawable.isLoaded == 'undefined') {

       AR.VideoDrawable.prototype.psLoaded = false;

       AR.VideoDrawable.prototype.isLoaded = function() {

        return this.psLoaded || false;

    }

}

 

And then assign psLoaded = true to the object in onLoaded method:

 

var video = new AR.VideoDrawable(videoFile, 0.43, {

    onLoaded: function() {

        this.psLoaded = true;

        World.loadingStep();

    }

});

 

 

Thanks for claryfing if isLoading() method is expected to be missing for AR.VideoDrawable class.
Login or Signup to post a comment