From 9ab66353a519cb6730ce9341aca6665023cc85a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Beaufort?= Date: Tue, 16 Jun 2020 06:43:07 +0200 Subject: [PATCH] Added {pan: 1} example --- ptz-explainer.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ptz-explainer.md b/ptz-explainer.md index f909820..28dffc3 100644 --- a/ptz-explainer.md +++ b/ptz-explainer.md @@ -106,6 +106,19 @@ if ("tilt" in capabilities) { } ``` +The example below shows how camera pan could be reset when acquiring a +PTZ camera in `getUserMedia()`. + +```js +// User is prompted to grant both camera and PTZ access in a single call. +// If the camera does not support PTZ or user denies PTZ permission, it fails +// as PTZ constraints are required. +const videoStream = await navigator.mediaDevices.getUserMedia({ + // [NEW] Website asks to reset camera pan. + video: { pan: 1 }, +}); +``` + [Spec PR](https://github.com/w3c/mediacapture-image/pull/218) ## Integration with the Permissions API