Git Product home page Git Product logo

lib-kurento's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

lib-kurento's Issues

ICE candidate race

Hey, thanks for the awesome lib!

I'm recreating the one2many kurento demo tutorial, and running into a simple problem: When I receive a "present" message from a client, I immediately set up a libKurento.WebRtcEndpointWrapper with the Sdp, but before it is constructed I also receive "onIceCandidate" from the client, so I am unable to call webRtcEndpoint.addClientIceCandidate on the endpoint to put it in the queue.

There's two ways I can think of fixing this without modifying lib-kurento: 1) Have the client only start sending onIceCandidates AFTER it receives the sdp answer. 2) queue the messages myself and pass them to the WebRtcEndpointWrapper when it is ready (not utilizing its internal queue)

That said, if I could create a libKurento.WebRtcEndpointWrapper WITHOUT specifying an sdp (so it could have it around to start queuing ice candidates whenever they are received), and then when I receive an sdp from the client I can call WebRtcEndpointWrapper.init(sdpOffer), that would allow me to utilize the internal queue of WebRtcEndpointWrapper.

So here's what I'm proposing:

  • Construct WebRtcEndpointWrapper with only a pipeline (no SDP)
  • Add a sdpOffer arg to init so when receiving an sdpOffer I call WebRtcEndpointWrapper.init(sdpOffer)

Of course I'm new to all this so I might be way off the mark -- please let me know if I'm thinking about this correctly!

Nice. Thanks for sharing

However, can't use your lib in my node ts app. What might go wrong?

import * as libKurento from 'lib-kurento';

src/index.ts(2,29): error TS2307: Cannot find module 'lib-kurento'.

Record error handling example

Thanks for sharing awesome library!
I suggest adding these lines to the Recording Example in README.md:

recorderEndpoint.endpoint.addListener('Error', (err) => {
  console.log('recorderEndpoint.endpoint error', err);
 })

It greatly helps to debug recording problems.

Recording HD videos: override max video bandwidth

If I call setMaxVideoRecvBandwidth() in my code

  await webRtcEndpoint.init()

  // no effect!
  await webRtcEndpoint.endpoint.setMaxVideoRecvBandwidth(50000)

it doesn't take effect (poor quality of recorded videos).

I had to modify SdpEndpointWrapper.init() to run setMaxVideoRecvBandwidth() before processOffer()

    async init() {
        await super.init();

        // mod
        await this._endpoint.setMaxVideoRecvBandwidth(50000)

        // process sdp offer
        this._sdpAnswer = await this._endpoint.processOffer(this._sdpOffer);
        this.emit("SdpAnswerCreated", this._sdpAnswer);
    }

Maybe it's a good idea to make some event on EndpointWrapper.init() right after _endpoint creation to have time to manipulate it before processOffer() begins.

    async init() {
        this._endpoint = await this._pipeline.create(this._endpointName, this._createOptions);
        this.emit("EndpointCreated", event);

or, simpler, no automatic processOffer() on SdpEndpointWrapper.init() (extract it to separate method)

Using [email protected]

RecordingStart event is not fired

// . . . . .

let createRecorderStateLogger = (eventLabel) => {
    let callback = (event) => {
        let descriptionParts = [event.type, event.mediaType, event.state].filter(x => x)
        let description = descriptionParts.join(' ')

        this.log(`recorderEndpoint : ${eventLabel} event: ${description}`)
    }
    callback.bind(this)
    return callback
}

let eventsNamesToLog = [
    'RecordingStarted', 'RecordingStopped',
    'MediaFlowingIn', 'MediaFlowingOut',
    'MediaStoppedFlowingIn', 'MediaStoppedFlowingOut',
]

// logging recorder state changes
for (let eventNameToLog of eventsNamesToLog) {
    this.recorderEndpoint.on(
        eventNameToLog,
        createRecorderStateLogger(eventNameToLog)
    );
}

this.recorderEndpoint.on('RecordingStarted', (evt) => {
    // NOT FIRED!!!
    this.wsMessageToClient({
        category: MessageFromServerCategory.recordingStarted,
    })
});

// start recording
await this.recorderEndpoint.record();

setTimeout(async () => {
    await this.recorderEndpoint.stopRecord();
}, 7000);
[25.12.2019 18:20:59] recorderEndpoint : MediaFlowingIn event: MediaFlowInStateChange AUDIO FLOWING
[25.12.2019 18:20:59] recorderEndpoint : MediaFlowingIn event: MediaFlowInStateChange VIDEO FLOWING
[25.12.2019 18:20:59] recorderEndpoint : RecordingStopped event: Recording
[25.12.2019 18:21:05] recorderEndpoint : RecordingStopped event: Stopped

Video file is saved normally but event object has type = 'Recording' on RecordingStopped event and RecordingStarted event is not fired at all.

// package-lock.json:

"lib-kurento": {
      "version": "0.0.5",
"kurento-client": {
      "version": "6.12.0",

WebSocket.on is not defined

Hi,
In both examples of the README, there's a call to socket.on where socket is of type WebSocket.
However, WebSocket does not have any member on. How do I proceed?

I'm compiling to es5 and have the libraries for es2019 and dom in my tsconfig.json

Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.