sfu-observer-js
    TypeScript icon, indicating that this package has built-in type declarations

    0.1.1 • Public • Published

    Sfu Observer

    This client application helps you sampling your SFU. After it is started, it generates SfuSamples. SfuSamples can be processed by an observer. Observer match samples originated from client applications and samples originated from SFU. After you setup an observer, you can integrate your SFU and start watching your transports.

    Install

    Install sfu-observer-js

        npm i sfu-observer-js

    Observe your SFU

    Mediasoup

        const { MediasoupSfuObserver } = require("sfu-observer-js");
        const mediasoup = require('mediasoup');
        // ...
        const POLLING_INTERVAL_IN_MS = 10000;
        const HOST = "localhost:7080";
        const SERVICE_ID = "myServiceId";
        const MEDIAUNIT_ID = "mySFU";
        const sfuObserver = MediasoupSfuObserver.builder()
                .withMediasoup(mediasoup)
                .withPollingInterval(POLLING_INTERVAL_IN_MS)
                .withEndpoint(`ws://${HOST}/sfusamples/${SERVICE_ID}/${MEDIAUNIT_ID}`)
                .build();
    
        // start monitoring when you want the service to start polling
        sfuObserver.start();
        
        // optionally, you can subscribe to the event emitted when a sample is ready
        sfuObserver
            .onSample(sample => {
                console.log("sfu sample", sample);
            })
            .onError(error => {
                console.warn("An error occurred", error);
            })
        ;
    
        // stop monitoring whenever you want no longer to monitor the service
        sfuObserver.stop();

    Install

    npm i sfu-observer-js

    DownloadsWeekly Downloads

    221

    Version

    0.1.1

    License

    Apache-2.0

    Unpacked Size

    183 kB

    Total Files

    44

    Last publish

    Collaborators

    • balazskreith