mediasoup-client-werift
v0.0.5
Published
mediasoup client side Node.js library using werift
Downloads
21
Maintainers
Readme
mediasoup-client-werift
Mediasoup client for nodejs using werift
fully compatible with mediasoup-client
inspired by mediasoup-client-node
Usage
import {
WeriftHandler,
type WeriftRtpCapabilities,
} from "mediasoup-client-werift";
import {
RTCRtpCodecParameters,
useFIR,
useNACK,
usePLI,
useREMB,
MediaStreamTrack,
} from "werift";
import { Device } from "mediasoup-client";
const weriftCapabilitis: WeriftRtpCapabilities = {
codecs: {
video: [
// if you want to use H264
new RTCRtpCodecParameters({
mimeType: "video/H264",
clockRate: 90000,
rtcpFeedback: [useFIR(), useNACK(), usePLI(), useREMB()],
parameters:
"level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f",
}),
],
audio: [
new RTCRtpCodecParameters({
mimeType: "audio/opus",
clockRate: 48000,
channels: 2,
}),
],
},
};
const device = new Device({
handlerFactory: WeriftHandler.createFactory(weriftCapabilitis),
});
// ... refer to mediasoup-client documentation