chromecast-java-api-v2 icon indicating copy to clipboard operation
chromecast-java-api-v2 copied to clipboard

Support passing customData to media load request

Open simon816 opened this issue 2 years ago • 0 comments

There are two issues here:

  • ChromeCast.load did not allow passing a customData parameter
  • The customData serialiser assumed an object with property payload containing 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.

simon816 avatar Sep 19 '23 23:09 simon816