Platforms to show: All Mac Windows Linux Cross-Platform
Back to AVCaptureDeviceMBS class.
AVCaptureDeviceMBS.authorizationStatusForMediaType(mediaType as string) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | AVFoundation | MBS AVFoundation Plugin | 18.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Mediatype: The media type, either AVMediaTypeVideo or AVMediaTypeAudio.
Returns the authorization status of the client
This method returns the AVAuthorizationStatus of the client for accessing the underlying hardware supporting the media type. Media type constants are defined in AVFoundationMBS. If any media type other than AVMediaTypeVideo or AVMediaTypeAudio is supplied, an NSInvalidArgumentException will be thrown. If the status is AVAuthorizationStatusNotDetermined, you may use the requestAccessForMediaType method to request access by prompting the user.
see
https://developer.apple.com/documentation/avfoundation/cameras_and_media_capture/requesting_authorization_for_media_capture_on_macos?language=objc
Some examples using this method:
AVCaptureDeviceMBS.available as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns true on Mac OS X 10.7 and newer.
AVCaptureDeviceMBS.AVCaptureMaxAvailableTorchLevel as Double
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | AVFoundation | MBS AVFoundation Plugin | 14.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
This constant always represents the maximum available torch level, independent of the actual maximum value currently supported by the device. Thus, pass this constant to the setTorchModeOnWithLevel:error: in situations where you want to specify the maximum torch level without having to worry about whether the device is overheating and might not accept a value of 1.0 as the maximum.
Available in OS X v10.9 and later.
AVCaptureDeviceMBS.defaultDeviceWithMediaType(mediaType as string) as AVCaptureDeviceMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
mediaType: A media type identifier.
For possible values, see AV Foundation Constants Reference.
Some examples using this method:
- /AVFoundation/Device List
- /AVFoundation/iOS Live QRCode Detect/iOS Live QRCode Detect
- /AVFoundation/Live Barcode Detection
- /AVFoundation/Live Barcode Detection iOS/Live Barcode Detection iOS
- /AVFoundation/Live Barcode Detection with Vision/Live Barcode Detection with Vision
- /AVFoundation/Live picture processing
- /AVFoundation/Recorder
- /AVFoundation/Still Photos
AVCaptureDeviceMBS.devices as AVCaptureDeviceMBS()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
AVCaptureDeviceMBS.devicesWithMediaType(mediaType as string) as AVCaptureDeviceMBS()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
mediaType: A media type identifier.
For possible values, see AV Foundation Constants Reference.
Some examples using this method:
AVCaptureDeviceMBS.deviceWithUniqueID(deviceUniqueID as string) as AVCaptureDeviceMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
deviceUniqueID: The ID of a capture device.
AVCaptureDeviceMBS.requestAccessForMediaType(mediaType as string, tag as variant = nil)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | AVFoundation | MBS AVFoundation Plugin | 18.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
mediaType: The media type, either AVMediaTypeVideo or AVMediaTypeAudio
Use this function to request access to the hardware for a given media type. Media type constants are defined in AVFoundationMBS
If any media type other than AVMediaTypeVideo or AVMediaTypeAudio is supplied, an NSInvalidArgumentException will be thrown.
This call will not block while the user is being asked for access, allowing the client to continue running. Until access has been granted, any AVCaptureDevices for the media type will vend silent audio samples or black video frames. The user is only asked for permission the first time the client requests access. Later calls use the permission granted by the user.
Note that the authorization dialog will automatically be shown if the status is AVAuthorizationStatusNotDetermined when creating an AVCaptureDeviceInput.
Invoking this method with AVMediaTypeAudio is equivalent to calling AVAudioSessionMBS.requestRecordPermission.
Call returns directly as request is performed on thread.
The requestAccessForMediaTypeCompleted event is called later in your AVFoundationMBS subclass with results on main thread.
The granted value will always true for MacOS 10.13 or older.
see
https://developer.apple.com/documentation/avfoundation/cameras_and_media_capture/requesting_authorization_for_media_capture_on_macos?language=objc
Some examples using this method:
The items on this page are in the following plugins: MBS AVFoundation Plugin.