Bishwa Timilsina
Bishwa Timilsina

Reputation: 1243

Uncaught TypeError: navigator.webkitGetUserMedia is not a function

I want to build video chatting website using WebRTC. I am using chrome chrome 83.0.4103.97. I have followed https://www.youtube.com/watch?v=ieBtXwHvoNk for this. But got the error in my browser. My code and error is below

navigator.webkitGetUserMedia({ video: true, audio: false}, function(stream){
//
}, function(err){
    console.error(err)
})

enter image description here

Upvotes: 1

Views: 1185

Answers (1)

Tanmoy Majumdar
Tanmoy Majumdar

Reputation: 458

try the following

navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;

now you can use it as

navigator.getUserMedia({ video: true, audio: false}, function(stream){
 }, function(err){
 console.error(err)
})

Upvotes: 1

Related Questions