Addon.Webcam.GetMediaType()

Description

Retrieves the media types supported by the current webcam.

Syntax

.Addon.Webcam.GetMediaType();

Parameters

None

Return value

An object of the type <WebcamMediaType> is returned which contains a list of all available media types. Methods available in the object are

Data Type Method Name Description
<int> GetCount() Returns the count of available media types.
<string> Get(int index) Returns a media type from the list.
<string> GetCurrent() Returns the current media type.

Remarks

The method should be called after Addon.Webcam.SelectSource. If there is only one data source available, it will be selected automatically.

Example

DWObject.Addon.Webcam.SelectSource(document.getElementById("source").options[document.getElementById("source").selectedIndex].text);
var _MediaTypeList = DWObject.Addon.Webcam.GetMediaType();
var count = _MediaTypeList.GetCount();
for (i = 0; i < count; i++) {
	alert("Index: " + i + "; Media Type: " + _MediaTypeList.Get(i));
}
alert("Current Media Type: " + _MediaTypeList.GetCurrent());

See also

Addon.Webcam.SetMediaType

Is this page helpful?

Leave a Reply

Your email address will not be published.