ImageCapture.ImageCapture()

Non-standard
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

The ImageCapture constructor creates a new ImageCapture object which creates a new ImageCapture object.

Syntax

var imageCapture = new ImageCapture(videoTrack)

Parameters

videoTrack
A reference to a MediaStreamTrack.

Example

The following example shows how to use a call to MediaDevices.getUserMedia() to retrieve the MediaStreamTrack needed by the ImageCapture() constructor.

 navigator.mediaDevices.getUserMedia({video: true})
.then(mediaStream => { 
  document.querySelector('video').srcObject = mediaStream
  const track = mediaStream.getVideoTracks()[0];
  imageCapture = new ImageCapture(track);
})
.catch(error => console.log(error));

Specifications

Specification Status Comment
MediaStream Image Capture
The definition of 'ImageCapture' in that specification.
Working Draft Initial definition.

Browser Compatibility

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 59 ? ? 46 ?
Feature Android Webview Chrome for Android Firefox Mobile (Gecko) Firefox OS IE Mobile Opera Mobile Safari Mobile
Basic support 59 59 ? ? ? 46 ?

Document Tags and Contributors

Contributors to this page: jpmedley
Last updated by: jpmedley,