There is an example in chromecast documentation
https://developers.google.com/cast/docs/player#streamdrm
which mentions to set the customData for receiver with.
host.licenseCustomData = customData;
On iOS sender app
we have
GCKMediaInformation *mediaInformation = [[GCKMediaInformation alloc] initWithContentID:[url absoluteString]
streamType:streamType
contentType:mimeType
metadata:metadata
streamDuration:0
customData:customData];
So I can pass that customData here in the media Information.
The other way to do it is, we pass the intial url of stream to receiver and then receiver the extracts the information of customData from url inside the receiver.
Which is the preferred way to do it.
It doesn't really matter, whichever works for your case and is easier for you can be used. One thing to keep in mind is whether it makes any difference when multiple devices are connected to the same receiver; one approach may make it easier for multi-sender case than the other one.