Vuforia: How to play video only when image target is detected

I am new to scripting and trying to figure out how to alter the code below so that the video only plays once the target is recognize and then stops when the target is removed. I realize I need to turn off “play on awake” inside of Unity but I believe I need to also include code that starts the video when the target is detected. Any advice greatly appreciated. Thank you.

public class DefaultTrackableEventHandler : MonoBehaviour, ITrackableEventHandler

{
#region PROTECTED_MEMBER_VARIABLES

protected TrackableBehaviour mTrackableBehaviour;
protected TrackableBehaviour.Status m_PreviousStatus;
protected TrackableBehaviour.Status m_NewStatus;

#endregion // PROTECTED_MEMBER_VARIABLES

#region UNITY_MONOBEHAVIOUR_METHODS

protected virtual void Start()
{
    mTrackableBehaviour = GetComponent<TrackableBehaviour>();
    if (mTrackableBehaviour)
        mTrackableBehaviour.RegisterTrackableEventHandler(this);
}

protected virtual void OnDestroy()
{
    if (mTrackableBehaviour)
        mTrackableBehaviour.UnregisterTrackableEventHandler(this);
}

#endregion // UNITY_MONOBEHAVIOUR_METHODS

#region PUBLIC_METHODS

public void OnTrackableStateChanged(
    TrackableBehaviour.Status previousStatus,
    TrackableBehaviour.Status newStatus)
{
    m_PreviousStatus = previousStatus;
    m_NewStatus = newStatus;

    if (newStatus == TrackableBehaviour.Status.DETECTED ||
        newStatus == TrackableBehaviour.Status.TRACKED ||
        newStatus == TrackableBehaviour.Status.EXTENDED_TRACKED)
    {
        Debug.Log("Trackable " + mTrackableBehaviour.TrackableName + " found");
        OnTrackingFound();
    }
    else if (previousStatus == TrackableBehaviour.Status.TRACKED &&
             newStatus == TrackableBehaviour.Status.NO_POSE)
    {
        Debug.Log("Trackable " + mTrackableBehaviour.TrackableName + " lost");
        OnTrackingLost();
    }
    else
    {

        OnTrackingLost();
    }
}

#endregion // PUBLIC_METHODS

#region PROTECTED_METHODS

protected virtual void OnTrackingFound()
{
    var rendererComponents = GetComponentsInChildren<Renderer>(true);
    var colliderComponents = GetComponentsInChildren<Collider>(true);
    var canvasComponents = GetComponentsInChildren<Canvas>(true);

    // Enable rendering:
    foreach (var component in rendererComponents)
        component.enabled = true;

    // Enable colliders:
    foreach (var component in colliderComponents)
        component.enabled = true;

    // Enable canvas':
    foreach (var component in canvasComponents)
        component.enabled = true;
}

protected virtual void OnTrackingLost()
{
    var rendererComponents = GetComponentsInChildren<Renderer>(true);
    var colliderComponents = GetComponentsInChildren<Collider>(true);
    var canvasComponents = GetComponentsInChildren<Canvas>(true);

    // Disable rendering:
    foreach (var component in rendererComponents)
        component.enabled = false;

    foreach (var component in colliderComponents)
        component.enabled = false;

    foreach (var component in canvasComponents)
        component.enabled = false;
}

#endregion // PROTECTED_METHODS

}

hello, whats the porpuse of your app? since i have had a lot of issues with videoplayer and android. i dont know in the latest versions of unity, but before you invest your time in creating your app (as i did), make sure all the target devices can view that video. (dont test it onlyi in the editor and top devices if your target is generic public) if you continue doing the project, take into account that the gameobject will activate once the image gets track, so your issue is as simple as creating a script and attached to the object, and implement OnDisable and OnEnable methods that will be called when the object sets active or inactive