Changing time from playable director in control track

I have created a custom timeline playable which changes the time of its director like so:

[Serializable]
public class TimeJumpBehaviour : PlayableBehaviour
{
    public double newTime = double.NaN;

    private PlayableDirector director = null;

    public override void OnPlayableCreate (Playable playable)
    {
        // Get the director here, because the graph is not valid when paused.
        director = playable.GetGraph().GetResolver() as PlayableDirector;
    }

    public override void PrepareFrame(Playable playable, FrameData info)
    {
        if (!Application.isPlaying)
            return;

        // Some code left out for brevity

        director.time = newTime;
    }
}

Now this works fine when used in a “top level” playable director. However, when the playable director (A) that contains this clip is being controlled through a control track of another playable director (B), the director variable will get set to playable director A.

Setting the time on it has no effect in that case, presumably because it’s being controlled by playable director B.

How can I find the “top level” playable director from code so that changing the time has the desired effect?
I tried using GetRootPlayable(), but that doesn’t seem to make a difference in this case.

Thanks in advance!

Did you ever find a solution to this?