Skip to main content

DeviceMedia

Namespace: Wisej.Hybrid

Assembly: Wisej.Hybrid

Access media through Device.Media. The signatures below follow the XML documentation in the published Wisej-4-Hybrid 4.1.4 package. Native behavior still depends on platform handlers, permissions and hardware; see Platform Capabilities.

Constructors​

DeviceMedia()​

Use the Device.Media singleton rather than constructing a separate module.

Properties​

CaptureSupported​

bool: whether media capture is supported by the connected device.

Methods​

CapturePhoto(maxWidth, maxHeight, quality, rotation)​

Takes a photo using the device camera. The parameters are int maxWidth, int maxHeight, float quality and float rotation. Quality affects JPEG output. The former single-quality signature on this page did not match the published 4.1.4 XML.

CapturePhotoAsync(maxWidth, maxHeight, quality, rotation)​

The asynchronous photo capture method has the same parameter types. Await its result from an async Wisej event handler.

CaptureVideo()​

Captures a video and returns MP4 bytes. The published method has no quality parameter.

CaptureVideoAsync()​

The asynchronous video capture method returns the video bytes when the operation completes.

PickPhoto(maxWidth, maxHeight, quality)​

Picks a photo from the device library. The parameters are int maxWidth, int maxHeight and double quality. The returned photo is an image; quality affects JPEG output.

PickPhotoAsync(maxWidth, maxHeight, quality)​

The asynchronous photo picker has the same parameter types.

PickVideo()​

Picks a video and returns MP4 bytes. The published method has no quality parameter.

PickVideoAsync()​

The asynchronous video picker returns the video bytes when the operation completes.

Example​

Use the package's required size arguments when picking a photo:

var photo = await Device.Media.PickPhotoAsync(1280, 720, 1.0);

Call this inside an async handler, handle a missing result, and dispose an image when its owning view no longer needs it. Newer cancellation, error propagation and format-preservation changes are tracked as unreleased work; do not infer their behavior from the existence of an async method in an older package.

See Examples for current application source and validation limits.