TaifunPlayer stops after 2 min looping on Android 14 in background

The TaifunPlayer extension stops after ~2 minutes when looping an audio track (duration 20 seconds) in the background on Android 14.

TaifunPlayerLoop_test.aia (230.7 KB)
@Taifun

Others may check t on Android 14+.

In the foreground?

No, in the background. No problem on Android < 14.

Probably Android 14 has more restrictive battery saving.

No problem with the Player component. But it does not loop seamlessly.

So we need also for playing audio files from the assets or external storage a Foreground service to prevent Doze (in the background).

Starting from Android 13+, it is required to declare the foreground service type.

It works fine without foreground service on Android 13.

1 Like

The problem only occurs due to the special gapless looping feature since Android 14. As already mentioned, the Player component does not have this issue when looping.

What is this new feature? Any reference?

Use an extension that is based on ExoPlayer and you will have no looping problems.

I discussed this topic with Taifun and a few others more than 5 years ago. This was also the main reason why I switched to Kodular back then. The topic of "ExoPlayer" and its version problems at Kodular were also discussed intensively and extensively there for months. A version upgrade never took place. There is still no usable ExoPlayer extension (especially for using audio).

I can make an ExoPlayer extension based on Media3 without unnecessary things, having only basic functions like in the Taifun extension.

2 Likes