How to Initialize LevelSequencePlayer Using C++

I am trying to initialize a LevelSequencePlayer using C++. However, for the life of me I can’t figure out how to do this. Directly referencing the LevelSequencePlayer.h does nothing, and I do not know how to proceed. I am at a roadblock as how to proceed, since some additional functionality using the LevelSequencePlayer is necessary for our project. A sample initializing the LevelSequencePlayer would be awesome.

Please note: I am not looking to use blueprints, so don’t recommend using blueprints.

Would the developer of the sequencer please write a short example how to work with that beautiful piece in C++ code!
Would really appreciate this.

Second this!

Third this!

Im using 4.21 so im not sure if that matters or not but i figured out how to do this:

You have to spawn an actor called ALevelSequenceActor as below:

In .h:

UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
ALevelSequenceActor* MovieActor;

UPROPERTY(EditAnywhere, BlueprintReadOnly)
ULevelSequence* IntroMovieSequence;

in a .cpp function i have this:

if(IsValid(IntroMovieSequence))
{

MovieActor = GetWorld()->SpawnActor<ALevelSequenceActor>();

MovieActor->SetSequence(IntroMovieSequence);
MovieActor->SequencePlayer->Play();

}

you can check to see if the movie is playing by doing this:
MovieActor->SequencePlayer->IsPlaying()

and when its done playing i destroy the actor.

Hope this helps!

UPDATE: It picked up the new dependencies after going to File → Refresh Visual Studio Project

For some reason I cannot seem to get these types recognized. I’ve added “LevelSequence”, “MovieScene” to my .Build.cs file…but VS still cannot pick up ALevelSequenceActor or LevelSequencePlayer (it does recognize UMovieSceneSequencePlayer, but the Initialize method always crashes the editor for me)