I am using a custom Chromecast receiver and casting functionality. I want to pass custom metadata to the receiver.
In documentation i found that PlayerAPI | Bitmovin Player API 8.126.0.
// Send custom messages to CAF receiver
var payload = { foo: ‘bar’ };
player.addMetadata(‘CAST’, payload);
Its returning TRUE where i can console metadata at recivers end
Please assist. Thanks in advance.
Hi @madhuy1729 , thanks for sharing your question here.
Custom data can be passed to CAF receiver at time of starting casting. This can be done by adding metadata to the source being loaded.
The source.metadata property is present in all 3 platforms SDKs(Web, iOS and Android). The type of metadata property is mentioned in documentation for each SDK.
Web : SourceConfig.metadata . Any <String, String> key value pairs can be set as custom metadata. Example below.
Please let me know if this helps of if there are any followup questions.
iOS : SourceConfig.metadata. Type is NSMutableDictionary. But entries of dictionary should be <String, String> key value pairs.
Then on CAF receiver side, this will be available in cast.framework.messages.MessageType.LOAD message which can be intercepted as demonstrated in Bitmovin reference CAF receiver implementation. You will need to customize the implementation and get the metadata passed in from Cast sender in LoadRequestData.media.customData.metadatafield.