How to detect Browser, OS, Screen Resolution, Speakers, Microphone & Webcam using Javascript

Last modified on by Karthikeyan K

In this post, I would like to share some useful tutorial which you cant find it anywhere. Now a days all  web based application requires video and audio chat capabilities for real time communications.

WebRTC is an open framework for the web that enables Real Time Communications in the browser. It includes the fundamental building blocks for high-quality communications on the web, such as network, audio and video components used in voice and video chat applications.

These components, when implemented in a browser, can be accessed through a JavaScript API, enabling developers to easily implement their own RTC web app.

So before delivering real time communication to the user, we need to identify the user’s system components whether it supports WebRTC or not.

This tutorial is very useful to check system requirements in client side


webrtc - Detect System Components using Javascript

Below script is used to get all the datas required to implement real time communications like video chat, audio chat, white board interactions etc

Step 1:

Place the below javascript in the bottom of the page (above </body> tag)

<script src=""> </script>

Step 2:

Use the below functions to get the required data

    DetectRTC.hasWebcam (has webcam device!)
DetectRTC.hasMicrophone (has microphone device!)
DetectRTC.hasSpeakers (has speakers!)



DetectRTC.audioInputDevices // microphones
DetectRTC.audioOutputDevices // speakers
DetectRTC.videoInputDevices // cameras

DetectRTC.osVersion === 'Edge' || 'Chrome' || 'Firefox'

DetectRTC.browser.isPrivateBrowsing // incognito or private modes


I hope you like this article and Please like us in facebook or subscribe to my blog to get the latest updates

View Live Demo Download


This tutorial is very useful to check system requirements in client side


Credit –

You May Also Like

1 Response

  1. George says:

    Thanks a Lot Mr karthik

    I failed to get webcam and speaker details in my application. Your post helped me and now I got all the required data.

    You are really awesome 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *