mirror of
https://github.com/pion/mediadevices.git
synced 2025-09-26 20:41:46 +08:00
Add DeviceType to MediaDeviceInfo
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package mediadevices
|
||||
|
||||
import "github.com/pion/mediadevices/pkg/driver"
|
||||
|
||||
// MediaDeviceType enumerates type of media device.
|
||||
type MediaDeviceType int
|
||||
|
||||
@@ -12,7 +14,8 @@ const (
|
||||
|
||||
// MediaDeviceInfo represents https://w3c.github.io/mediacapture-main/#dom-mediadeviceinfo
|
||||
type MediaDeviceInfo struct {
|
||||
DeviceID string
|
||||
Kind MediaDeviceType
|
||||
Label string
|
||||
DeviceID string
|
||||
Kind MediaDeviceType
|
||||
Label string
|
||||
DeviceType driver.DeviceType
|
||||
}
|
||||
|
@@ -279,10 +279,12 @@ func (m *mediaDevices) EnumerateDevices() []MediaDeviceInfo {
|
||||
default:
|
||||
continue
|
||||
}
|
||||
driverInfo := d.Info()
|
||||
info = append(info, MediaDeviceInfo{
|
||||
DeviceID: d.ID(),
|
||||
Kind: kind,
|
||||
Label: d.Info().Label,
|
||||
DeviceID: d.ID(),
|
||||
Kind: kind,
|
||||
Label: driverInfo.Label,
|
||||
DeviceType: driverInfo.DeviceType,
|
||||
})
|
||||
}
|
||||
return info
|
||||
|
Reference in New Issue
Block a user