I'm writing code for webrtc, and I'm following the manual, but there's something I don't understand.
useEffect(() => {
mediaDevices.enumerateDevices().then(data => {
console.log('enumerateDevices 로그');
console.log(data);
});
}, []);
Why is the type of result 'data' not inferred in enumerateDevices?
The reason why this is curious is that the data returned by getUserMedia in the same library is used for data inference.
useEffect(() => {
mediaDevices
.getUserMedia({
audio: true,
video: true,
})
.then(data => {
console.log('getUserMedia 로그');
Check the screenshot above
The value returned by getUserStream is inferred to be of type MediaStream.
I'm curious about this, what's the problem? Or is there a good reason? I wonder why
I'm curious about this, what's the problem? Or is there a good reason? I wonder why