Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
ImagePicker.SetMediaTypes
Sets the list of media types to access.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
ImagePicker | 13.2 | ❌ No | ❌ No | ❌ No | ❌ No | ✅ Yes |
MBS( "ImagePicker.SetMediaTypes"; MediaTypes ) More
Parameters
Parameter | Description | Example |
---|---|---|
MediaTypes | The media types to request. | "public.movie¶public.image" |
Result
Returns OK or error.
Description
Sets the list of media types to access.Depending on the media types you assign to this property, the picker displays a dedicated interface for still images or movies, or a selection control that lets the user choose the picker interface. Before setting this property, check which media types are available by calling the ImagePicker.AvailableMediaTypesForSourceType function.
If you set this property to an empty list, or to an list in which none of the media types is available for the current source, the system returns an error.
When capturing media, the value of this property determines the camera interface to display. When browsing saved media, this property determines the types of media presented in the interface.
By default, the value of this property is the image identifier, which designates the still camera interface when capturing media, and specifies that only still images should be displayed in the media picker when browsing saved media. The following example shows how to designate the movie capture interface, or to indicate that only movies should be displayed when browsing saved media.
You may just query ImagePicker.AvailableMediaTypesForSourceType for the media types.
Examples
Request camera as source and let's make video:
Set Variable [ $r ; Value: MBS( "ImagePicker.New" ) ]
Set Variable [ $r ; Value: MBS( "ImagePicker.SetSourceType"; "Camera" ) ]
Set Variable [ $r ; Value: MBS( "ImagePicker.SetMediaTypes"; "public.movie") ]
Set Variable [ $r ; Value: MBS( "ImagePicker.Present") ]
Request image or video:
Set Variable [ $r ; Value: MBS( "ImagePicker.SetMediaTypes"; "public.image¶public.movie") ]
See also
- ImagePicker.AvailableMediaTypesForSourceType
- ImagePicker.MediaType
- ImagePicker.MediaTypes
- ImagePicker.New
- ImagePicker.Present
- ImagePicker.SetSourceType
Release notes
- Version 13.2
- Added ImagePicker.SetMediaTypes function.
Blog Entries
Created 2nd May 2023, last changed 2nd May 2023