chromecast-java-api-v2
chromecast-java-api-v2 copied to clipboard
Support passing customData to media load request
There are two issues here:
ChromeCast.loaddid not allow passing acustomDataparameter- The
customDataserialiser assumed an object with propertypayloadcontaining an object with only string values.
From the documentation (https://developers.google.com/cast/docs/media/messages#Load):
Name Type Description customData object optional Application-specific blob of data defined by the sender application
There shouldn't be any assumptions about how this is serialised, so providing an Object gives the caller the greatest flexibility.
Given that the functions to construct the StandardRequest.Load object are package-private and that no public method exists to set customData, I believe it's unlikely anyone is relying on the existing serialisation (i.e. wrapped in an object property payload).
Use case: When reverse engineering the Soundcloud client controller in Chrome, I found it required a customData object on the LOAD event, which I could not set with this library without resorting to reflection.