Added zoom to UI

This commit is contained in:
Christoph Oberhofer
2017-04-03 22:48:32 +02:00
parent 6f8bbe96d2
commit b2ac66eb72
5 changed files with 42 additions and 24 deletions
+3 -3
View File
@@ -78,7 +78,7 @@ function resolveMinWidthToAdvanced({aspectRatio, minPixels}) {
.map(({pre}) => pre);
}
function getOrCreateVideo(source, target) {
function getOrCreateVideo(target) {
const $viewport = getViewport(target);
if ($viewport) {
let $video = $viewport.querySelector("video");
@@ -153,10 +153,10 @@ function adjustWithZoom(videoConstraints) {
};
}
export function fromCamera(constraints) {
export function fromCamera(constraints, {target} = {}) {
var {video: videoConstraints, zoom} = adjustWithZoom(constraints);
const video = getOrCreateVideo();
const video = getOrCreateVideo(target);
return CameraAccess.request(video, videoConstraints)
.then(function(mediastream) {
const track = mediastream.getVideoTracks()[0];