While using visual.VlcMovieStim to play movies the program crashed by access violention

Hellow everyone,

I met somee problems while trying to use visual.VlcMovieStim() to play movies as stimulus in an experiment. Though I found some way to prevent the prevent the program to crash, the problems are still not be fixed and I want to share them.
The code I used to play the movies is like:

for current_movie_index in range(len(movie_list)):  
    current_movie_name = movie_list[current_movie_index]
    print(f"[info] NO.{current_movie_index}: {current_movie_name}")
    current_movie_path = movie_folder + "/" + current_movie_name
    if not os.path.exists(current_movie_path):
        raise IndexError(f"Can't find movie \"{current_movie_name}\" in \"{current_movie_path}\"")
    current_movie = visual.VlcMovieStim(
        window,
        current_movie_path,
        size=(960, 540),
        pos=(0, 0),
        flipVert=False,
        flipHoriz=False,
        loop=False
    )
    current_movie_play = current_movie.play()
    start_time = get_time_stamp()
    while current_movie.status != visual.FINISHED:
        current_movie.draw()
        window.flip()
        movie_keyboard_control(window, current_movie)

And the trigger for the photosensor is like:

triggerON = visual.Circle(
   window, 
   size=(40, 40), 
   units="pix", 
   lineWidth=0, 
   fillColor=(1, 1, 1), 
   pos=(-900, 0)
)

My problem is that, if I insert the trigger during the time the movies were playing by using the code as:

    while current_movie.status != visual.FINISHED:
        triggerON.draw()
        current_movie.draw()
        window.flip()

The program will crash and the error code is 3221225477, which refers to an access violence. This error will not happen if I use MovieStim2 or MovieStim3.
If I change the way to way to insert trigger like:

    current_movie_play = current_movie.play()
    triggerON.draw()
    window.flip()
    start_time = get_time_stamp()
    while current_movie.status != visual.FINISHED:
        current_movie.draw()
        window.flip()
        movie_keyboard_control(window, current_movie)
    triggerON.draw()
    end_time = get_time_stamp()
    window.flip()

If I insert the trigger before and after current_movie.draw(), this problem seemed not happen. But if I just play the movies one by one, either randomly or randomly, the 3221225477 error will happen by chance. So I and my colleague guess that this problem is caused by while the psychopy(or pyglet) trying to draw the texture of the movie on window, some problem happended. But we can confirm what the exact problem is.

As mentioned before, I can avoid the 3221225477 error by using MovieStim2 or MovieStim3, but they have other problems. MovieStim2 can not play the movies correctly, the videos flipped during playing. And while using MovieStim3, tat the end of some movies, the audio might loop for 1 or 2 seconds. VlcMoiveStim with vlc media player 3.0.18 is the best way I find to play these movies by psychopy.

My enviroment is windows10 with psychopy 2022.2.5, the version of vlc media player is 3.0.18, and the same problem happened also on MacOSX 12.6.1 with psychopy 2022.2.5 and vlc media player 3.0.18.

Is anyone faced this kind of error too? And do you have any idea how to fix this problem or avoid crashing while using VlcMovieStim?

Best wishes and thank you very much.