Cast: Message exceeds maximum size
Author: scooter1556Created Nov 25, 2020Updated Aug 17, 2026
Labelsenhancement
Use case description
If you initialise a large number of MediaItems using setMediaItems() on a CastPlayer it is possible to hit the CastClient maximum message size throwing an IllegalArgumentException.
CastClient: Message send failed. Message exceeds maximum size
java.lang.IllegalArgumentException: Message exceeds maximum size524288
Proposed solution
Gracefully handle setting and adding large MediaItem lists by splitting into multiple RemoteMediaClient queue requests.
Source: google/ExoPlayer