Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
themeRDark
function publishStream(session) {
    var streamName = $('#url').val().split('/')[3];
    session.createStream({
        name: streamName,
        display: localVideo,
        record: true,
        receiveVideo: false,
        receiveAudio: false
        ...
    }).publish();
}

Stream recording on demand

Sometimes, it is necessary to record the stream that already exists on server, mixer output stream for example. This can be done with REST API.

REST query must be HTTP/HTTPS POST query like this:

  • HTTP: http://streaming.flashphoner.com:9091/rest-api/stream/startRecording
  • HTTPS: https://streaming.flashphoner.com:8888/rest-api/stream/startRecording

Where:

  • streaming.flashphoner.com is WCS server address
  • 9091 is a standard WCS REST / HTTP port
  • 8888 is a standard WCS REST / HTTPS port
  • rest-api is mandatory prefix
  • /stream/startRecording is REST method

REST methods and response statuses

REST method

Example of REST query

Example of REST response

Response statuses

Description

/stream/startRecording


Code Block
languagejs
themeRDark
{
 "mediaSessionId": "5a072377-73c1-4caf-abd3"
}

404 - Not found

500 - Internal error


Start stream recording in specified mediasession


/stream/stopRecording
Code Block
languagejs
themeRDark
{
 "mediaSessionId": "5a072377-73c1-4caf-abd3"
}

404 - Not found

500 - Internal error

Stop stream recording in specified mediasession

Parameters

Parameter name

Description

Example

mediaSessionId

Идентификатор сессии

5a072377-73c1-4caf-abd3