
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
webrtc-codec-support
Advanced tools
Simple browser library to check if WebRTC supports the specified codecs for receiving and publishing.
Inspired by my long troubleshooting session in Firefox with disabled H.264 plugin and Firefox incorrectly reporting it as ICE communication problem.
Install with npm (npm install webrtc-codec-support --save) or download a prebundled package from Releases (webpack umd2 module format, includes the sdp parser library dependencies already).
The library exports a WebrtcCodec class, with static instances for each codec it supports:
Video codecs:
WebRtcCodec.VP8
WebRtcCodec.VP9
WebRtcCodec.H264
Audio codecs:
WebRtcCodec.OPUS
WebRtcCodec.ISAC
WebRTC always supports the VP8 and OPUS codecs, these are included for completeness.
The isWebrtcReceiveCodecSupportedfunction returns a boolean Promise.
isWebrtcReceiveCodecSupported(WebrtcCodec.H264).then((supported)=>{
if (supported) console.log("H.264 supported");
});
The isWebrtcPublishCodecSupportedfunction takes a pre-acquired MediaStream object returns a boolean Promise. The MediaStream object must contain a video track if checking for video codecs, and an audio track if checking for audio codecs. It can contain both as well.
navigator.mediaDevices.getUserMedia({video:true, audio:true}).then((mediaStream) => {
isWebrtcPublishCodecSupported(mediaStream, WebrtcCodec.H264).then((supported)=>{
if (supported) console.log("H.264 supported");
});
});
When checking if receiving a codec is possible, we build a dummy minimal SDP as if coming from signaling, and ask the browser to create an answer sdp, which we parse and check if the specified codec is present in the answer.
For publishing, a media stream has to be acquired already and we simply analyze the offer SDP created by the WebRTC stack, parsing it for codecs.
Unlicense - Human knowledge belongs to the world.
FAQs
Checks if a codec is supported by WebRTC stack in browser
The npm package webrtc-codec-support receives a total of 108 weekly downloads. As such, webrtc-codec-support popularity was classified as not popular.
We found that webrtc-codec-support 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
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.