UniWebViewChannelMethodMediaCapturePermission

Summary

Represents the request of media capture permission.

This class represents the request of media capture permission. When the web page requests the permission to access the device's hardware, such as the camera or microphone, UniWebView will ask you to handle the request with a value of this class. You can use the values in this class to determine the decision for the permission request.

Properties Summary

The protocol used by the permission request.

The host of the origin of the permission request.

The port of the origin of the permission request.

The string representation of the resources of the origin of the permission request.

Properties

The protocol used by the permission request. Such as "https" or "http".

Example

// A permission request from 
// "https://webrtc.github.io/samples/src/content/getusermedia/gum/"

permission.Protocol // "https"

The host of the origin of the permission request.

It is usually the domain of the web page.

Example

// A permission request from 
// "https://webrtc.github.io/samples/src/content/getusermedia/gum/"

permission.Host // "webrtc.github.io"

The port of the origin of the permission request.

If not existing in the request URL, it is -1.

Example

// A permission request from 
// "https://webrtc.github.io/samples/src/content/getusermedia/gum/"

permission.Port // -1

The string representation of the resources of the origin of the permission request.

An array contains requested resources, the most common values are "VIDEO", "AUDIO". On Android, some pages can also requests for "PROTECTED_MEDIA_ID", "MIDI_SYSEX", etc.

Example

// A permission request from 
// "https://webrtc.github.io/samples/src/content/getusermedia/gum/"

permission.Resources // ["VIDEO"]