ABCDEFGHIJKLMNOPQRSTUVWX
1
Given:
var videoTrack;
var imageCapturer = new ImageCapture(videoTrack);
https://tinyurl.com/image-capture-migration-guidehttps://crbug.com/700607
2
Before, you did...and that returned...Now, to get the same info/effect now you should...gotchas?
3
imageCapturer.getPhotoCapabilities().then((caps) => { caps.whiteBalanceMode; });A single MeteringMode, being the current setting.videoTrack.getCapabilities().whiteBalanceMode
and
videoTrack.getSettings().whiteBalanceMode
where videoTrack.getCapabilities().whiteBalanceMode is now a series of
supported MeteringModes.
4
imageCapturer.getPhotoCapabilities().then((caps) => { caps.exposureMode; });A single MeteringMode, being the current setting.videoTrack.getCapabilities().exposureMode
and
videoTrack.getSettings().exposureMode
where videoTrack.getCapabilities().exposureMode is now a series of
supported MeteringModes.
5
imageCapturer.getPhotoCapabilities().then((caps) => { caps.focusMode; });A single MeteringMode, being the current setting.videoTrack.getCapabilities().focusMode
and
videoTrack.getSettings().focusMode
where videoTrack.getCapabilities().focusMode is now a series of
supported MeteringModes.
6
7
imageCapturer.getPhotoCapabilities().then((caps) => { caps.colorTemperature; });A MediaSettingsRange: {min, max, current, step }videoTrack.getCapabilities().colorTemperature
and
videoTrack.getSettings().colorTemperature
8
imageCapturer.getPhotoCapabilities().then((caps) => { caps.exposureCompensation; });A MediaSettingsRange: {min, max, current, step }videoTrack.getCapabilities().exposureCompensation
and
videoTrack.getSettings().exposureCompensation
9
imageCapturer.getPhotoCapabilities().then((caps) => { caps.iso; });A MediaSettingsRange: {min, max, current, step }videoTrack.getCapabilities().colorTemperature
and
videoTrack.getSettings().colorTemperature
10
11
imageCapturer.getPhotoCapabilities().then((caps) => { brightness; });A MediaSettingsRange: {min, max, current, step }videoTrack.getCapabilities().brightness
and
videoTrack.getSettings().brightness
12
imageCapturer.getPhotoCapabilities().then((caps) => { contrast; });A MediaSettingsRange: {min, max, current, step }videoTrack.getCapabilities().contrast
and
videoTrack.getSettings().contrast
13
imageCapturer.getPhotoCapabilities().then((caps) => { saturation; });A MediaSettingsRange: {min, max, current, step }videoTrack.getCapabilities().saturation
and
videoTrack.getSettings().saturation
14
imageCapturer.getPhotoCapabilities().then((caps) => { sharpness; });A MediaSettingsRange: {min, max, current, step }videoTrack.getCapabilities().sharpness
and
videoTrack.getSettings().sharpness
15
16
imageCapturer.getPhotoCapabilities().then((caps) => { imageHeight; });A MediaSettingsRange: {min, max, current, step }No changes! Keep doing the same thing.
17
imageCapturer.getPhotoCapabilities().then((caps) => { imageWidth; });A MediaSettingsRange: {min, max, current, step }No changes! Keep doing the same thing.
18
19
imageCapturer.getPhotoCapabilities().then((caps) => { zoom; });A MediaSettingsRange: {min, max, current, step }videoTrack.getCapabilities().zoom
and
videoTrack.getSettings().zoom
20
21
imageCapturer.getPhotoCapabilities().then((caps) => { fillLightMode; });A single FillLightMode ("none", "off", "auto", "flash", "torch").FillLightModes other than torch stay the same."torch" mode is not one of FillLightModes anymore, and is accessed via
the videoTrack
22
videoTrack.getCapabilities().torch
and
videoTrack.getSettings().torch
23
imageCapturer.getPhotoCapabilities().then((caps) => { caps.redEyeReduction; });A single boolean, being the current setting.No changes! Keep doing the same thing.Actually, the returned value is not a boolean anymore, but a sequence of
booleans, indicating if the feature can be controlled and/or turned off
24
25
imageCapturer.setOptions({ whiteBalanceMode : foo });Where foo is a MeteringMode ("none", "manual", "single-shot", "continuous");videoTrack.applyConstraints({ advanced : [{whiteBalanceMode : foo }]});
26
imageCapturer.setOptions({ exposureMode : foo });Where foo is a MeteringMode ("none", "manual", "single-shot", "continuous");videoTrack.applyConstraints({ advanced : [{ exposureMode : foo }]});
27
imageCapturer.setOptions({ focusMode : foo });Where foo is a MeteringMode ("none", "manual", "single-shot", "continuous");videoTrack.applyConstraints({ advanced : [{ focusMode : foo }]});
28
29
imageCapturer.setOptions({ exposureCompensation : foo });Where foo is a double.
videoTrack.applyConstraints({ advanced : [{ exposureCompensation : foo }]});
30
imageCapturer.setOptions({ colorTemperature : foo });Where foo is a double.videoTrack.applyConstraints({ advanced : [{ colorTemperature : foo }]});
31
imageCapturer.setOptions({ iso : foo });Where foo is a double.videoTrack.applyConstraints({ advanced : [{ iso : foo }]});
32
33
imageCapturer.setOptions({ brightness : foo });Where foo is a double.videoTrack.applyConstraints({ advanced : [{ brightness : foo }]});
34
imageCapturer.setOptions({ contrast : foo });Where foo is a double.videoTrack.applyConstraints({ advanced : [{ contrast : foo }]});
35
imageCapturer.setOptions({ saturation : foo });Where foo is a double.videoTrack.applyConstraints({ advanced : [{ saturation : foo }]});
36
imageCapturer.setOptions({ sharpness : foo });Where foo is a double.videoTrack.applyConstraints({ advanced : [{ sharpness : foo }]});
37
38
imageCapturer.setOptions({ imageHeight : foo });Where foo is a double.imageCapturer.takePhoto({ imageWidth : foo });Only applicable at takePhoto() time.
39
imageCapturer.setOptions({ imageWidth : foo });Where foo is a double.imageCapturer.takePhoto({ imageHeight : foo });Only applicable at takePhoto() time.
40
41
imageCapturer.setOptions({ zoom : foo });Where foo is a double.videoTrack.applyConstraints({ advanced : [{ zoom : foo }]});
42
43
imageCapturer.setOptions({ redEyeReduction : foo });Where foo is a boolean.imageCapturer.takePhoto({ redEyeReduction : foo });Only applicable at takePhoto() time.
44
imageCapturer.setOptions({ fillLightMode : foo });Where foo is a FillLightMode ("none", "off", "auto", "flash", "torch");imageCapturer.takePhoto({ fillLightMode : foo });Only applicable at takePhoto() time.
45
videoTrack.applyConstraints({ advanced : [{ torch : foo }]});"torch" mode is not one of FillLightModes anymore; needs to be configured via
the videoTrack.applyConstraints() method
46
47
imageCapturer.setOptions({ pointsOfInterest : foo });Where foo is a sequence<Point2D> (e.g. [{x : 0.1, y : 0.2}, {x : 0.3, y : 0.4}] )videoTrack.applyConstraints({ advanced : [{ pointsOfInterest : foo }]});Where foo is the same sequence<Point2D> (e.g. [{x : 0.1, y : 0.2}] )
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100