Sound files not looping properly

URL of experiment: MA_Exp [PsychoPy]

Description of the problem:
Hi all,

when running my experiment online through Pavlovia, i am encountering issues with the looping of my audio files. The experiment shows a video and plays an audio file at the same time. While the mp4 files can be of varying length, my wav files are all 6 seconds long.

I have 2 sets of trials in my experiment, in the first set (4 ‘test’ trials total) everything is fine and all of the video and audio files played have a similar length of 6 seconds.

The issue arises in the second set of trials (80 ‘real’ trials total), where the video lengths vary between 4 and 16 seconds. My aim is to have the audio loop to match the length of the video and stop playing together with the video.

Offline things work fine using a simple
if not trial_audio.isPlaying:
trial_audio.play()
code component.

Glad for any help i can get!