<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 10.7.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVCaptureDevice/hasMediaType(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVCaptureDevice(im)hasMediaType:"
  },
  "title" : "hasMediaType(_:)"
}
-->

# hasMediaType(_:)

Returns a Boolean value that indicates whether the device captures media of a particular type.

```
func hasMediaType(_ mediaType: AVMediaType) -> Bool
```

## Parameters

`mediaType`

A media type, such as [`video`](/documentation/AVFoundation/AVMediaType/video), [`audio`](/documentation/AVFoundation/AVMediaType/audio), or [`muxed`](/documentation/AVFoundation/AVMediaType/muxed).

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the device captures media of the specified type; otherwise, <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

---

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)