Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
media-core
Advanced tools
A Typescript code, based on MediaRecorder() API to get MediaRecorder.
If you want to see complete UI react voice recording you can use this package ( React Voice Recorder )
npm i media-core
OR
yarn add media-core
Recording audio sample.
import { IMedia, MediaCore } from 'media-core';
const mediaRecorder: MediaRecorder | null = null;
const getMedia = async (): void => {
const mediaConfig: IMedia = {
Constraints: {
audio: true
},
mediaRecorderOptions: {
mimeType: 'audio/webm'
}
}
try {
mediaRecorder = await MediaCore(mediaConfig);
} catch (e) {
// catch error
}
}
MediaCore
This function return MediaRecorder, you must pass config that use IMedia Interface, if this function can not return MediaRecorder instance it throw an error.
interface IErrorMessage {
id: number
message: string
}
For error id I use enum and I exported it.
enum ErrorEnum {
Security,
RejectPermission,
TypeSupport
}
MediaCoreConfig
You must pass this config to the MediaCore.
interface IMedia {
Constraints: {
audio?: boolean,
video?: boolean
},
mediaRecorderOptions?: {
mimeType: string
audioBitsPerSecond?: number,
videoBitsPerSecond?: number
bitsPerSecond?: number,
}
}
Feel free to submit a PR if you found a bug (I might've missed many! 😀) or if you want to enhance it further.
Thanks!. Happy Recording!
FAQs
A Typescript code, based on MediaRecorder() API to get MediaRecorder
We found that media-core 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.