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

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support59 ? ? ?46 ?
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support5959 ? ?46 ?7.0

Document Tags and Contributors

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