givo / lib-kurento

A typescript library for simplifying the use of Kurento in Node.js
24 stars 5 forks source link

RecordingStart event is not fired #5

Closed d9k closed 4 years ago

d9k commented 4 years ago
// . . . . .

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",
givo commented 4 years ago

Hi,

Please install version v0.07, try again and let me know the results

d9k commented 4 years ago

@givo, seems to be working, thx)