Package com.castlabs.sdk.googlecast

# Interface GoogleCastManager.CastInfoProvider

Enclosing class:
  `GoogleCastManager`

public static interface GoogleCastManager.CastInfoProvider
Optional cast info provider to add or modify request cast params.

The `GoogleCastManager.startCasting(PlayerController, SessionManager, MediaMetadata)` and `GoogleCastManager.startCasting(Bundle, SessionManager, MediaMetadata)` methods will map the info from the provided `PlayerController` or `Bundle` respectively. If any of those mappings should be changed or any further fields should be added, do so in the `onSendCastRequest(Bundle, JSONObject)`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `onSendCastRequest(Bundle bundle, JSONObject jsonObject)`
  Will be called with the built JSONObject right before sending it to the cast device.

- ## Method Details

  - ### onSendCastRequest

    void onSendCastRequest(@NonNull Bundle bundle, @NonNull JSONObject jsonObject)
    Will be called with the built JSONObject right before sending it to the cast device.

    Any desired changes should be done on the provided JSONObject.

    Parameters:
      `bundle` - The bundle provided when calling `GoogleCastManager.startCasting(Bundle, SessionManager, MediaMetadata)` or the one created mapping info from the `PlayerController` if `GoogleCastManager.startCasting(PlayerController, SessionManager, MediaMetadata)` was used instead.
      `jsonObject` - An instance of `JSONObject` that can be modified. This object will be sent to the cast device as a param in the `MediaInfo.Builder.setCustomData(JSONObject)` method. If you want to access/modify drm-related info, use the "drmtoday" or "drm" fields for DrmToday or other kind of Drm respectively. If no Drm info was provided in the Bundle passed to `GoogleCastManager.startCasting(Bundle, SessionManager, MediaMetadata)` these keys won't exist in this object. In that case, you should also set on it the `"drmProtected"` key to `true`.