Video producer of an easy to use one-to-many broadcasting tool based on mediasoup.
npm install mediasoup-easy-one-to-many-producer-js
Call useProduce
to setup a producer using your options. useProduce
will return functions that let you establish the connection to the mediasoup router (connect
) and start publishing a stream (publish
).
import { useProduce } from "mediasoup-easy-one-to-many-producer-js";
const { connect, publish } = useProduce({
url: "http://localhost:8080",
});
// ...
connect() // initialize the connection to the mediasoup router
// ...
publish() // start publishing a stream
// ...
Returns functions for connecting to the server and publishing a video stream.
ProduceOptions
Field & Type | Description | Required | Default |
---|---|---|---|
url string |
URL of the server where the mediasoup router is running on | Yes |
- (Sometimes) doesn't work in react inside of
<React.StrictMode>