Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
webrtc-browser-test
Advanced tools
Test video and audio capabilities of the browser, verifying hardware works properly.
Test video and audio capabilities of the browser, verifying hardware works properly.
This detects whether your browser supports the WebRTC API for video and audio, gathers video and audio hardware information, and initializes video and audio streaming to the browser. It will give feedback for whether the user has granted permission to the browser, and whether any other errors have occurred. It will also provide volume information from the microphone if it's enabled and working properly.
This will throw a few custom types of errors, depending on what breaks and when.
ParameterError
- Parameter passed is either missing or incorrect type.BrowserNotSupportedError
- The browser either doesn't support Promise
s, WebRTC, or Web Audio (used for the volume meter).VideoNotFoundError
- The browser couldn't detect any video input hardware.VideoDeniedError
- The user denied permission to the browser to use the video input.AudioNotFoundError
- The browser couldn't detect any audio input hardware.AudioDeniedError
- The user denied permission to the browser to use the audio input.None
var browserTest = WebRtcBrowserTest(opts);
browserTest.startAll();
Options:
mediaElementContainer
(required) - The element (or selector) of where you want the video and audio elements to appear on the page.onVolumeChange
(optional) - Callback returning the current volume (RMS normalized from 0 to 1).webrtc-browser-test
uses Promise
s to run the various tests. The tests you can run are:
checkBrowser()
- Check whether the browser has the getUserMedia()
method.startVideo()
- Requests local video access and displays it in the browser.startAudio()
- Requests local video access and outputs it to the speakers. Also begins outputting volume to the optional onVolumeChange
callback.startAll()
- Run all the above tests.var browserTest = WebRtcBrowserTest({
mediaElementContainer: '#mediaContainer',
onVolumeChange: function(level) {
console.log('Volume: ' + level);
}
});
browserTest.startAll().then(function() {
console.log('started');
}).catch(function(err) {
message.innerHTML = err.name + '\n' + err.message;
console.log(err);
});
npm run demo
MIT
FAQs
Test video and audio capabilities of the browser, verifying hardware works properly.
The npm package webrtc-browser-test receives a total of 10 weekly downloads. As such, webrtc-browser-test popularity was classified as not popular.
We found that webrtc-browser-test demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.