O'Reilly logo

JavaScript by Example by Dani Akash S

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

MediaStream

MediaStream API is used for getting access to the video and audio devices of the user. Generally, browsers will prompt the user as to whether he/she wants to allow the website to access the camera and microphone of his/her device. Even though the underlying concept for MediaStream API is the same, different browser vendors have implemented the API differently.

While using the getUserMedia() method with {audio: true} to access your own microphone, either mute the speakers or mute the HTML video element. Otherwise, it might cause feedback that can damage your speakers.

For example, in Chrome, to use MediaStream API, you need to use the navigator.getUserMedia() method. Also, Chrome allows MediaStream to work only in localhost or ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required