blob: b51d697dd9e8c158fed9f2c28050f016c0f6fb81 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
---
title: Navigator.mediaDevices
slug: Web/API/Navigator/mediaDevices
translation_of: Web/API/Navigator/mediaDevices
---
<div>{{APIRef("Media Capture and Streams")}}</div>
<p>The <strong><code>Navigator.mediaDevices</code></strong> read-only property returns a {{domxref("MediaDevices")}} object, which provides access to connected media input devices like cameras and microphones, as well as screen sharing.</p>
<h2 id="Syntax">Syntax</h2>
<pre class="syntaxbox notranslate">var <em>mediaDevices</em> = navigator.mediaDevices;
</pre>
<h3 id="Return_value">Return value</h3>
<p>The {{domxref("MediaDevices")}} singleton object. Usually, you just use this object's members directly, such as by calling {{domxref("navigator.mediaDevices.getUserMedia()")}}.</p>
<h2 id="Spesifikasi">Spesifikasi</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Spesifikasi</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
<tr>
<td>{{SpecName('Media Capture', '#mediadevices', 'NavigatorUserMedia.mediaDevices')}}</td>
<td>{{Spec2('Media Capture')}}</td>
<td>Initial definition.</td>
</tr>
</tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{Compat("api.Navigator.mediaDevices")}}</p>
<h2 id="Lihat_juga">Lihat juga</h2>
<ul>
<li><a href="/en-US/docs/Web/API/Media_Streams_API">Media Capture and Streams API</a>: The entry point to the documentation about the entire media stream API.</li>
<li><a href="/en-US/docs/Web/API/WebRTC_API">WebRTC API</a>: Documentation about the WebRTC API, which is closely related.</li>
</ul>
|