---
updatedAt: 2026-07-27T10:02:54.000Z
agentTools:
  projectIndex: https://developers.dailymotion.com/v0/llms.txt
---

# Chromecast (iOS SDK)

The Dailymotion Cast SDK allows you to **easily integrate a casting feature on your Dailymotion Player** with minimum requirements.

> 👍 Chromecast module is optional
>
> The iOS SDK can be integrated without the Chromecast module. It is optional and can be excluded based on your project requirements.

<Callout icon="💡" theme="default">
  ### Demo

  Check our **[sample apps](https://developers.dailymotion.com/v0/docs/sample-app-ios-sdk)** for an example on how to use, integrate and customise the Cast SDK with the Dailymotion Player on iOS environment
</Callout>

***

<br />

# Prerequisites

* [Google Cast SDK for iOS](https://developers.google.com/cast/docs/ios_sender#xcode_setup)  must be integrated, as the Dailymotion Cast SDK relies on it.
* Your **Player** must be integrated using our [iOS SDK](https://developers.dailymotion.com/v0/docs/getting-started-with-the-ios-sdk).

<br />

***

<br />

# 1. Add `NSBonjourServices` to your `Info.plist`

Specify `NSBonjourServices` in your `Info.plist` file to allow local network discovery to succeed on iOS 14.

Add both `_googlecast._tcp`  and `_B88B034A._googlecast._tcp`  as services to **allow proper device discovery** as follow:

```swift
<key>NSBonjourServices</key>
<array>
  <string>_googlecast._tcp</string>
  <string>_B88B034A._googlecast._tcp</string>
</array>
```

<br />

# 2. Add `NSLocalNetworkUsageDescription` to your `Info.plist`

We strongly recommend **customizing the message shown in the "Local Network" prompt** to explain why your app needs access to the users' local network.

Add in your `Info.plist` file an app-specific permission string for `NSLocalNetworkUsageDescription` explaining that your app needs access to the users' local network to discover cast-enabled devices and other discovery services, like DIAL. Customize the message as you need.

```swift
<key>NSLocalNetworkUsageDescription</key>
<string>${PRODUCT_NAME} uses the local network to discover Cast-enabled devices on your WiFi
network.</string>
```

This prompt appears as part of the iOS Local Network Access dialog the first time users try to cast from your app.

<br />

<Image align="center" border={true} width="300px" src="https://files.readme.io/d3b28929f504b9515c0b8c4ff255423612a8a7a99a8b96c9ec0f4b9714a4cc13-Screenshot-2024-02-02-at-16.59.12.png" className="border" />

<br />

# 3. Add a cast button

In order for the cast feature to be operational, you need to add a **cast button** in the UI. You can use the default one provided by the [**Google Cast SDK**](https://developers.google.com/cast/docs/ios_sender/integrate#the_cast_ux_widgets) .

```swift
let castButton = GCKUICastButton(frame: CGRect(x: 0, y: 0, width: 24, height: 24))
castButton.tintColor = UIColor.gray
navigationItem.rightBarButtonItem = UIBarButtonItem(customView: castButton)
```

Find more info about the cast button in [**Google Cast documentation**](https://developers.google.com/cast/docs/design_checklist/cast-button#sender-cast-icon-available) .

<br />

# 4. Mini controller and expanded controller (Optional)

Enrich the user experience using the UI controller options provided by default in the Google Cast SDK:

* [**Mini controller**](https://developers.google.com/cast/docs/ios_sender/integrate#add_mini_controllers)
* [**Expanded controller**](https://developers.google.com/cast/docs/ios_sender/integrate#add_expanded_controller) <br />

# 5. UI customization (Optional)

You can customize the Google Cast SDK provided UI as shown below:

```swift
// Get the shared instance of GCKUIStyle
let castStyle = GCKUIStyle.sharedInstance()
 
// Set the property of the desired cast Views
// Navigation bar buttons style
castStyle.castViews.deviceControl.connectionController.navigation.buttonTextColor = .black
 
// Tool bar style
castStyle.castViews.deviceControl.connectionController.toolbar.backgroundColor = .white
castStyle.castViews.deviceControl.connectionController.toolbar.buttonTextColor = .black
 
// Connection controller style
castStyle.castViews.deviceControl.connectionController.backgroundColor = .white
castStyle.castViews.deviceControl.connectionController.iconTintColor = .black
castStyle.castViews.deviceControl.connectionController.headingTextColor = .black
castStyle.castViews.deviceControl.connectionController.bodyTextColor = .black
 
// Device chooser style
castStyle.castViews.deviceControl.deviceChooser.backgroundColor = .white
castStyle.castViews.deviceControl.deviceChooser.iconTintColor = .black
castStyle.castViews.deviceControl.deviceChooser.headingTextColor = .black
castStyle.castViews.deviceControl.deviceChooser.captionTextColor = .black
 
// Refresh all currently visible views with the assigned styles
castStyle.apply()

```

<br />

Find more information and examples on **how to style the default UI** in [**Google Cast documentation**](https://developers.google.com/cast/docs/ios_sender/customize_ui#applying_a_style_to_a_ui_element_of_a_widget) .