这是
实验性技术
检查
浏览器兼容性表格
要小心谨慎在生产中使用这之前。
deviceId
readonly property of the
MediaDeviceInfo
interface returns a
DOMString
that is an identifier for the represented device and is persisted across sessions.
It is un-guessable by other applications, and unique to the origin of the calling application. It is reset when the user clears cookies. For private browsing, a different identifier is used that is not persisted across sessions.
var deviceID = MediaDeviceInfo.deviceId
A
DOMString
.
| 规范 | 状态 | 注释 |
|---|---|---|
|
媒体捕获和流
The definition of 'deviceId' in that specification. |
候选推荐 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
deviceId
|
Chrome
55
注意事项
|
Edge 12 | Firefox 39 | IE 不支持 No |
Opera
不支持
No
注意事项
|
Safari 不支持 No |
WebView Android
55
注意事项
|
Chrome Android
55
注意事项
|
Firefox Android 39 |
Opera Android
不支持
No
注意事项
|
Safari iOS 不支持 No |
Samsung Internet Android
6.0
注意事项
|
完整支持
不支持
见实现注意事项。