How can i display button on start of a video??

0 votes
asked Jul 11, 2017 by suresh2291 (170 points)
Hi All,
I want to display button inside the layout,but the button should visible when video start to play.
Before the video is not yet to start button should not visible...
Please Guys help me to solve this problem..

1 Answer

0 votes
answered Jul 11, 2017 by kenn (18,750 points)
If you are using EasyAR SDK 2.0, reference the sample code for isRenderTextureAvailable, display button when it returns true.

For older versions, display button when the player callback gives a Ready event.
commented Jul 12, 2017 by suresh2291 (170 points)
Hi Kenn,
I have declared the button inside MainActivity Class  which is an Activity Class and isRenderTextureAvailable is available in ARVideo class which is normal class.How can use this object in MainActivity.Since i cannot use button inside Class.

My Objective is to display button when video start and perform onClick event after the button display.

I cannot perform these events inside the class.

Please can you let me know through sample code snippet....

Thank You.
commented Jul 12, 2017 by suresh2291 (170 points)
edited Jul 12, 2017 by suresh2291
This is my layout xml




I need to use the declared ImageButton inside Activity class(

I have done this way
declared Image Button and ARvideo class object inside MainActivity
 public ImageButton share,review,productInfo;

public ARVideo video = new ARVideo();

Inside OnCreate Method i have initialise  button
share = (ImageButton) findViewById(;

            public void onSuccess()
                //int status = 0;
                share = (ImageButton) findViewById(;
                ((ViewGroup) findViewById(, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
                Log.i("isRenderTexture", String.valueOf(video.isRenderTextureAvailable()));
                if(video.isRenderTextureAvailable() == true)
commented Jul 21, 2017 by kenn (18,750 points)
It is not a problem of how to use EasyAR, but how to build your app. There are many ways to do this, for example, you can rewrite the sample in your favorite way, or just send a message to the main activity.
I'm not an expert of Android app development, sorry not giving you any specific code for solution.
Welcome to EasyAR SDK Q&A, where you can ask questions and receive answers from other members of the community.