Hiding button ( AR)

Hi
I am designing an android application where the user scans a marker then a play button appears and when he touches it , a video plays .
the problem is that after the user scans the marker the play button ( i inserted a canvas group to it ) appears on the screen and doesn’t hide even if you move the camera away from the marker .
Any one can help to make the play button hidden after it is clicked or it hides when the user moves the camera away from the marker ?

The Script i used is here

using UnityEngine;
using System.Collections;

public class NewBehaviourScript2 : MonoBehaviour {

    public void video (){
        Handheld.PlayFullScreenMovie ("3.mp4", Color.black, FullScreenMovieControlMode.Full);

        GetComponent<CanvasGroup>().alpha= 0F;
    }


                }

Why don’t you use a bool that is true if marker is on camera and false if it’s not? (I’ve never worked with AR, so I’m not sure)

Thanks for replying
I hide the button by this code

using UnityEngine;
using System.Collections;

public class NewBehaviourScript2 : MonoBehaviour {
  
    // Use this for initialization
    public void video (){
            float g;
        bool i;
        Handheld.PlayFullScreenMovie ("3.mp4", Color.black, FullScreenMovieControlMode.Full);
        g = 0f;
        i = false;
        GetComponent<CanvasGroup>().alpha= g;
        GetComponent<CanvasGroup> ().interactable = i;
        g = 1f;
        i = true;
        }
    }

but the problem is that the button is alawys hidden even if the users scans the marker again , i didn’t find the way to reset the image target so if any one can help