Skip to content

Commit

Permalink
Add Pan-Tilt-Zoom permission prompts (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
beaufortfrancois committed Jul 2, 2020
1 parent 521427a commit 5d4a873
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.html
Expand Up @@ -31,6 +31,8 @@
<button id="camera">Camera</button>
<button id="microphone">Microphone</button>
<button id="camera+microphone">Camera + Microphone</button>
<button id="pan-tilt-zoom">Pan-Tilt-Zoom</button>
<button id="pan-tilt-zoom+microphone">Pan-Tilt-Zoom + Microphone</button>
<button id="screenshare">Screen Share</button>
<button id="midi">MIDI</button>
<button id="bluetooth">Bluetooth</button>
Expand Down
26 changes: 26 additions & 0 deletions index.js
Expand Up @@ -143,6 +143,32 @@ window.addEventListener("load", function() {
displayOutcome("camera+microphone", "error")
);
},
"pan-tilt-zoom": function() {
navigator.mediaDevices ?
navigator.mediaDevices.getUserMedia(
{video: {pan: true, tilt: true, zoom: true}}).then(
displayOutcome("pan-tilt-zoom", "success"),
displayOutcome("pan-tilt-zoom", "error")
) :
navigator.getUserMedia(
{video: {pan: true, tilt: true, zoom: true}},
displayOutcome("pan-tilt-zoom", "success"),
displayOutcome("pan-tilt-zoom", "error")
);
},
"pan-tilt-zoom+microphone": function() {
navigator.mediaDevices ?
navigator.mediaDevices.getUserMedia(
{video: {pan: true, tilt: true, zoom: true}, audio: true}).then(
displayOutcome("pan-tilt-zoom+microphone", "success"),
displayOutcome("pan-tilt-zoom+microphone", "error")
) :
navigator.getUserMedia(
{video: {pan: true, tilt: true, zoom: true}, audio: true},
displayOutcome("pan-tilt-zoom+microphone", "success"),
displayOutcome("pan-tilt-zoom+microphone", "error")
);
},
"screenshare": function() {
navigator.mediaDevices.getDisplayMedia().then(
displayOutcome("screenshare", "success"),
Expand Down

0 comments on commit 5d4a873

Please sign in to comment.