<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MediaDevice",
  "identifier" : "/documentation/MediaDevice",
  "metadataVersion" : "0.1.0",
  "role" : "Framework",
  "symbol" : {
    "kind" : "Framework",
    "modules" : [
      "Media Device"
    ],
    "preciseIdentifier" : "MediaDevice"
  },
  "title" : "Media Device"
}
-->

# Media Device

Let people stream media from any iOS app to your playback hardware through the media device picker.

## Overview

Media Device lets you make your playback hardware available to the system. People can then stream to it from any iOS app, selecting your device from the media device picker. The picker is the same UI people use for AirPlay and Bluetooth output. You build a [`MediaDeviceExtension`](/documentation/MediaDevice/MediaDeviceExtension) that the system loads when someone opens the picker, and your extension handles discovery, connection, and playback on behalf of the system.

> Note: Your extension and the container app require the <doc://com.apple.documentation/documentation/BundleResources/Entitlements/com.apple.developer.media-device-extension> entitlement.

![An illustration showing an external speaker on the left wirelessly connecting to an iPhone on the right. Here, the speaker is an external media device that someone can connect to their iPhone using a Media Device extension.](images/com.apple.mediadevice/media-device-framework-hero@2x.png)

The extension life cycle follows three phases: discovery, activation, and playback. During
discovery, your extension reports available devices to the system through
[`MediaDeviceRoutingManager`](/documentation/MediaDevice/MediaDeviceRoutingManager). Your devices appear in the media device picker that media apps present to people. When someone selects one of your devices, the system creates a
[`MediaOutputSession`](/documentation/MediaDevice/MediaOutputSession) and asks your extension to connect. After your extension connects and calls [`activatedDevice(_:session:)`](/documentation/MediaDevice/MediaDeviceRoutingManager/activatedDevice(_:session:)), the system notifies supporting media apps about the selected device, and they can call playback APIs such as [`startSession(_:identifier:url:)`](/documentation/MediaDevice/MediaDeviceExtension/startSession(_:identifier:url:)).

Your extension may also register to receive real-time audio and video samples by conforming to [`RealtimeSampleHandling`](/documentation/MediaDevice/RealtimeSampleHandling). To capture those samples, follow <doc://com.apple.documentation/documentation/CoreAudio/creating-an-audio-server-driver-plug-in> for audio, and use <doc://com.apple.documentation/documentation/ScreenCaptureKit> for video.

Media Device works with <doc://com.apple.documentation/documentation/AVSystemRouting>,
which provides the API for media apps. Media apps use <doc://com.apple.documentation/documentation/AVSystemRouting/AVSystemRouteController-18ns8> to observe
route changes, and <doc://com.apple.documentation/documentation/AVSystemRouting/AVSystemRoute-5s2um> to control playback while your extension handles the protocol-specific communication with the hardware.

## Topics

### Essentials

[Creating a media device extension](/documentation/MediaDevice/creating-a-media-device-extension)

Provide a way for people to find, connect to, and control your media device by adding a device extension in your iOS app.

  <doc://com.apple.documentation/documentation/AVSystemRouting/routing-media-to-third-party-devices>

[`MediaDeviceExtension`](/documentation/MediaDevice/MediaDeviceExtension)

A protocol that defines the requirements of a media device extension that discovers, activates, and plays media on a remote device.

[`MediaDeviceExtensionConfiguration`](/documentation/MediaDevice/MediaDeviceExtensionConfiguration)

Configuration for the app extension.

### Device discovery and management

[`MediaOutputDevice`](/documentation/MediaDevice/MediaOutputDevice)

Represents a discoverable media output device such as a TV, speaker, or streaming stick.

[`MediaOutputDevice.Capabilities`](/documentation/MediaDevice/MediaOutputDevice/Capabilities-swift.struct)

Defines the media capabilities supported by a [`MediaOutputDevice`](/documentation/MediaDevice/MediaOutputDevice).

[`MediaOutputDevice.DeviceType`](/documentation/MediaDevice/MediaOutputDevice/DeviceType-swift.enum)

A device type used for display in user interfaces.

[`MediaOutputDevice.VolumeControl`](/documentation/MediaDevice/MediaOutputDevice/VolumeControl-swift.enum)

Defines the type of volume control supported by an output device or group.

[`MediaOutputDevice.AuthorizationMethod`](/documentation/MediaDevice/MediaOutputDevice/AuthorizationMethod)

Specifies what kind of authorization UI to present when connecting to a device.

### Session and system communication

[`MediaOutputSession`](/documentation/MediaDevice/MediaOutputSession)

Represents a media output session for playing content on a remote device.

[`MediaDeviceRoutingManager`](/documentation/MediaDevice/MediaDeviceRoutingManager)

An object used by a [`MediaDeviceExtension`](/documentation/MediaDevice/MediaDeviceExtension) to report device discovery, state changes, and playback events back to the system.

[`RealtimeSampleHandling`](/documentation/MediaDevice/RealtimeSampleHandling)

A protocol that extends a media device extension to support realtime sample delivery.

[`MediaDeviceError`](/documentation/MediaDevice/MediaDeviceError)

An error returned by MediaDeviceExtension operations.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)