Essential Kit
Loading...
Searching...
No Matches
MediaServices

Provides cross-platform interface to access devices's media gallery and camera for picking/saving media content.

Static Public Member Functions

static GalleryAccessStatus GetGalleryAccessStatus (GalleryAccessMode mode)
 Returns the current authorization status provided to access the gallery.
 
static CameraAccessStatus GetCameraAccessStatus ()
 Returns the current authorization status provided to access the camera.
 
static void SelectMediaContent (MediaContentSelectOptions options, EventCallback< IMediaContent[]> callback)
 Select media content from the gallery.
 
static void CaptureMediaContent (MediaContentCaptureOptions options, EventCallback< IMediaContent > callback)
 Capture media content from a camera.
 
static void SaveMediaContent (byte[] data, string mimeType, MediaContentSaveOptions options, EventCallback< bool > callback)
 Save media content to the gallery.
 
Advanced Usage
static void Initialize (MediaServicesUnitySettings settings)
 Initializes the media services module with the given settings.
 

Member Function Documentation

◆ Initialize()

static void Initialize ( MediaServicesUnitySettings settings)
static
Note
This call is optional and only need to be called if you have custom settings to initialize this feature.
Parameters
settingsThe settings to be used for initialization.

The settings configure the behavior of the media services module.

◆ GetGalleryAccessStatus()

static GalleryAccessStatus GetGalleryAccessStatus ( GalleryAccessMode mode)
static

To see different authorization status, see GalleryAccessStatus.

Parameters
modeThe access mode your app is requesting.

◆ GetCameraAccessStatus()

static CameraAccessStatus GetCameraAccessStatus ( )
static

To see different authorization status, see CameraAccessStatus.

◆ SelectMediaContent()

static void SelectMediaContent ( MediaContentSelectOptions options,
EventCallback< IMediaContent[]> callback )
static

Selects media content as per the options specified in MediaContentSelectOptions

Parameters
optionsA set of options that customize the behavior of the method.
callbackA callback which will be invoked after the user selects media content.

◆ CaptureMediaContent()

static void CaptureMediaContent ( MediaContentCaptureOptions options,
EventCallback< IMediaContent > callback )
static

Captures media content as per the options specified in MediaContentCaptureOptions

Parameters
optionsA set of options that customize the behavior of the method.
callbackA callback which will be invoked after the user captures media content.

◆ SaveMediaContent()

static void SaveMediaContent ( byte[] data,
string mimeType,
MediaContentSaveOptions options,
EventCallback< bool > callback )
static

Saves media content as per the options specified in MediaContentSaveOptions

Parameters
dataThe data to save to the gallery.
mimeTypeThe mime type of the data.
optionsA set of options that customize the behavior of the method.
callbackA callback which will be invoked after the data is saved to the gallery.