Error code 3016 with Chromecast and HLS stream

When I cast a video to chromecast and the video is not yet playing I see the following error in my debug overlay:

ShakaErrorCode 3016 ShakaErrorData CHUNK_DEMUXER_ERROR APPEND_FAILED: Parsed buffers not in DTS Sequence

This implies it is a problem with the content coming from Cloudflare Stream.

Our Chromecast receiver app is using ShakaPlayer. The problem is not with the player but is with the content.

If the video is already playing then we don’t get the error and chromecast works fine.

The problem only applies to videos encoded with a path with customer-[customer-id].cloudflarestream

It works fine for older videos