diff --git a/openvidu-node-client/README.md b/openvidu-node-client/README.md index 25f1413d..6e0568a1 100644 --- a/openvidu-node-client/README.md +++ b/openvidu-node-client/README.md @@ -7,7 +7,7 @@ openvidu-node-client === -- **Description**: Library for your NODE server. It makes easier the retrieval of the necessary params from OpenVidu Server for securing your application (_sessionId_'s and _token_'s). It is a simple alternative to the REST API. +- **Description**: Library for your NODE server. It is a fully compatible and simple alternative to the REST API exposed by OpenVidu Server. - **Docs**: [openvidu-node-client API](http://openvidu.io/docs/reference-docs/openvidu-node-client/) diff --git a/openvidu-node-client/config/typedoc.js b/openvidu-node-client/config/typedoc.js index 8bd08744..1bd4fc4e 100644 --- a/openvidu-node-client/config/typedoc.js +++ b/openvidu-node-client/config/typedoc.js @@ -7,19 +7,15 @@ module.exports = { ], mode: "file", module: "commonjs", - name: "OpenVidu Browser", + name: "OpenVidu Node Client", target: "es5", externalPattern: "node_modules", - exclude: [ - "**/OpenViduInternal/Interfaces/Private/**", - "**/OpenViduInternal/WebRtcStats/WebRtcStats.ts", - "**/OpenViduInternal/VersionAdapter.ts" - ], excludeExternals: true, excludePrivate: true, theme: "default", plugin: [ "typedoc-plugin-sourcefile-url", ], - 'sourcefile-url-prefix': "https://github.com/OpenVidu/openvidu/tree/master/openvidu-browser/src/" + 'sourcefile-url-prefix': "https://github.com/OpenVidu/openvidu/tree/master/openvidu-node-client/src/", + readme: "none" } \ No newline at end of file diff --git a/openvidu-node-client/docs/assets/js/search.js b/openvidu-node-client/docs/assets/js/search.js index 366e76c4..6a042470 100644 --- a/openvidu-node-client/docs/assets/js/search.js +++ b/openvidu-node-client/docs/assets/js/search.js @@ -1,3 +1,3 @@ var typedoc = typedoc || {}; typedoc.search = typedoc.search || {}; - typedoc.search.data = {"kinds":{"4":"Enumeration","16":"Enumeration member","32":"Variable","128":"Class","256":"Interface","512":"Constructor","1024":"Property","2048":"Method"},"rows":[{"id":0,"kind":4,"name":"MediaMode","url":"enums/mediamode.html","classes":"tsd-kind-enum"},{"id":1,"kind":16,"name":"RELAYED","url":"enums/mediamode.html#relayed","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MediaMode"},{"id":2,"kind":16,"name":"ROUTED","url":"enums/mediamode.html#routed","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MediaMode"},{"id":3,"kind":4,"name":"OpenViduRole","url":"enums/openvidurole.html","classes":"tsd-kind-enum"},{"id":4,"kind":16,"name":"SUBSCRIBER","url":"enums/openvidurole.html#subscriber","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"OpenViduRole"},{"id":5,"kind":16,"name":"PUBLISHER","url":"enums/openvidurole.html#publisher","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"OpenViduRole"},{"id":6,"kind":16,"name":"MODERATOR","url":"enums/openvidurole.html#moderator","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"OpenViduRole"},{"id":7,"kind":4,"name":"RecordingLayout","url":"enums/recordinglayout.html","classes":"tsd-kind-enum"},{"id":8,"kind":16,"name":"BEST_FIT","url":"enums/recordinglayout.html#best_fit","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"RecordingLayout"},{"id":9,"kind":16,"name":"PICTURE_IN_PICTURE","url":"enums/recordinglayout.html#picture_in_picture","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"RecordingLayout"},{"id":10,"kind":16,"name":"VERTICAL_PRESENTATION","url":"enums/recordinglayout.html#vertical_presentation","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"RecordingLayout"},{"id":11,"kind":16,"name":"HORIZONTAL_PRESENTATION","url":"enums/recordinglayout.html#horizontal_presentation","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"RecordingLayout"},{"id":12,"kind":16,"name":"CUSTOM","url":"enums/recordinglayout.html#custom","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"RecordingLayout"},{"id":13,"kind":4,"name":"RecordingMode","url":"enums/recordingmode.html","classes":"tsd-kind-enum"},{"id":14,"kind":16,"name":"ALWAYS","url":"enums/recordingmode.html#always","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"RecordingMode"},{"id":15,"kind":16,"name":"MANUAL","url":"enums/recordingmode.html#manual","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"RecordingMode"},{"id":16,"kind":256,"name":"SessionProperties","url":"interfaces/sessionproperties.html","classes":"tsd-kind-interface"},{"id":17,"kind":1024,"name":"mediaMode","url":"interfaces/sessionproperties.html#mediamode","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SessionProperties"},{"id":18,"kind":1024,"name":"recordingMode","url":"interfaces/sessionproperties.html#recordingmode","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SessionProperties"},{"id":19,"kind":1024,"name":"defaultRecordingLayout","url":"interfaces/sessionproperties.html#defaultrecordinglayout","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SessionProperties"},{"id":20,"kind":1024,"name":"defaultCustomLayout","url":"interfaces/sessionproperties.html#defaultcustomlayout","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SessionProperties"},{"id":21,"kind":256,"name":"TokenOptions","url":"interfaces/tokenoptions.html","classes":"tsd-kind-interface"},{"id":22,"kind":1024,"name":"data","url":"interfaces/tokenoptions.html#data","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"TokenOptions"},{"id":23,"kind":1024,"name":"role","url":"interfaces/tokenoptions.html#role","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"TokenOptions"},{"id":24,"kind":128,"name":"Session","url":"classes/session.html","classes":"tsd-kind-class"},{"id":25,"kind":512,"name":"constructor","url":"classes/session.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"Session"},{"id":26,"kind":2048,"name":"getSessionId","url":"classes/session.html#getsessionid","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Session"},{"id":27,"kind":2048,"name":"generateToken","url":"classes/session.html#generatetoken","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Session"},{"id":28,"kind":2048,"name":"getProperties","url":"classes/session.html#getproperties","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Session"},{"id":29,"kind":32,"name":"Buffer","url":"globals.html#buffer","classes":"tsd-kind-variable tsd-is-not-exported"},{"id":30,"kind":32,"name":"require","url":"globals.html#require","classes":"tsd-kind-variable tsd-is-not-exported"},{"id":31,"kind":32,"name":"https","url":"globals.html#https","classes":"tsd-kind-variable tsd-is-not-exported"},{"id":32,"kind":256,"name":"RecordingProperties","url":"interfaces/recordingproperties.html","classes":"tsd-kind-interface"},{"id":33,"kind":1024,"name":"name","url":"interfaces/recordingproperties.html#name","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"RecordingProperties"},{"id":34,"kind":1024,"name":"recordingLayout","url":"interfaces/recordingproperties.html#recordinglayout","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"RecordingProperties"},{"id":35,"kind":1024,"name":"customLayout","url":"interfaces/recordingproperties.html#customlayout","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"RecordingProperties"},{"id":36,"kind":128,"name":"Recording","url":"classes/recording.html","classes":"tsd-kind-class"},{"id":37,"kind":512,"name":"constructor","url":"classes/recording.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"Recording"},{"id":38,"kind":2048,"name":"getStatus","url":"classes/recording.html#getstatus","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Recording"},{"id":39,"kind":2048,"name":"getId","url":"classes/recording.html#getid","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Recording"},{"id":40,"kind":2048,"name":"getName","url":"classes/recording.html#getname","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Recording"},{"id":41,"kind":2048,"name":"getLayout","url":"classes/recording.html#getlayout","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Recording"},{"id":42,"kind":2048,"name":"getSessionId","url":"classes/recording.html#getsessionid","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Recording"},{"id":43,"kind":2048,"name":"getCreatedAt","url":"classes/recording.html#getcreatedat","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Recording"},{"id":44,"kind":2048,"name":"getSize","url":"classes/recording.html#getsize","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Recording"},{"id":45,"kind":2048,"name":"getDuration","url":"classes/recording.html#getduration","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Recording"},{"id":46,"kind":2048,"name":"getUrl","url":"classes/recording.html#geturl","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Recording"},{"id":47,"kind":2048,"name":"hasAudio","url":"classes/recording.html#hasaudio","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Recording"},{"id":48,"kind":2048,"name":"hasVideo","url":"classes/recording.html#hasvideo","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Recording"},{"id":49,"kind":4,"name":"Status","url":"enums/recording.status.html","classes":"tsd-kind-enum tsd-parent-kind-class tsd-is-static","parent":"Recording"},{"id":50,"kind":16,"name":"starting","url":"enums/recording.status.html#starting","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"Recording.Status"},{"id":51,"kind":16,"name":"started","url":"enums/recording.status.html#started","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"Recording.Status"},{"id":52,"kind":16,"name":"stopped","url":"enums/recording.status.html#stopped","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"Recording.Status"},{"id":53,"kind":16,"name":"available","url":"enums/recording.status.html#available","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"Recording.Status"},{"id":54,"kind":16,"name":"failed","url":"enums/recording.status.html#failed","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"Recording.Status"},{"id":55,"kind":128,"name":"OpenVidu","url":"classes/openvidu.html","classes":"tsd-kind-class"},{"id":56,"kind":512,"name":"constructor","url":"classes/openvidu.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"OpenVidu"},{"id":57,"kind":2048,"name":"createSession","url":"classes/openvidu.html#createsession","classes":"tsd-kind-method tsd-parent-kind-class","parent":"OpenVidu"},{"id":58,"kind":2048,"name":"startRecording","url":"classes/openvidu.html#startrecording","classes":"tsd-kind-method tsd-parent-kind-class","parent":"OpenVidu"},{"id":59,"kind":2048,"name":"stopRecording","url":"classes/openvidu.html#stoprecording","classes":"tsd-kind-method tsd-parent-kind-class","parent":"OpenVidu"},{"id":60,"kind":2048,"name":"getRecording","url":"classes/openvidu.html#getrecording","classes":"tsd-kind-method tsd-parent-kind-class","parent":"OpenVidu"},{"id":61,"kind":2048,"name":"listRecordings","url":"classes/openvidu.html#listrecordings","classes":"tsd-kind-method tsd-parent-kind-class","parent":"OpenVidu"},{"id":62,"kind":2048,"name":"deleteRecording","url":"classes/openvidu.html#deleterecording","classes":"tsd-kind-method tsd-parent-kind-class","parent":"OpenVidu"}]}; \ No newline at end of file + typedoc.search.data = {"kinds":{"4":"Enumeration","16":"Enumeration member","32":"Variable","128":"Class","256":"Interface","512":"Constructor","1024":"Property","2048":"Method"},"rows":[{"id":0,"kind":4,"name":"MediaMode","url":"enums/mediamode.html","classes":"tsd-kind-enum"},{"id":1,"kind":16,"name":"RELAYED","url":"enums/mediamode.html#relayed","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MediaMode"},{"id":2,"kind":16,"name":"ROUTED","url":"enums/mediamode.html#routed","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MediaMode"},{"id":3,"kind":4,"name":"OpenViduRole","url":"enums/openvidurole.html","classes":"tsd-kind-enum"},{"id":4,"kind":16,"name":"SUBSCRIBER","url":"enums/openvidurole.html#subscriber","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"OpenViduRole"},{"id":5,"kind":16,"name":"PUBLISHER","url":"enums/openvidurole.html#publisher","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"OpenViduRole"},{"id":6,"kind":16,"name":"MODERATOR","url":"enums/openvidurole.html#moderator","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"OpenViduRole"},{"id":7,"kind":4,"name":"RecordingLayout","url":"enums/recordinglayout.html","classes":"tsd-kind-enum"},{"id":8,"kind":16,"name":"BEST_FIT","url":"enums/recordinglayout.html#best_fit","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"RecordingLayout"},{"id":9,"kind":16,"name":"PICTURE_IN_PICTURE","url":"enums/recordinglayout.html#picture_in_picture","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"RecordingLayout"},{"id":10,"kind":16,"name":"VERTICAL_PRESENTATION","url":"enums/recordinglayout.html#vertical_presentation","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"RecordingLayout"},{"id":11,"kind":16,"name":"HORIZONTAL_PRESENTATION","url":"enums/recordinglayout.html#horizontal_presentation","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"RecordingLayout"},{"id":12,"kind":16,"name":"CUSTOM","url":"enums/recordinglayout.html#custom","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"RecordingLayout"},{"id":13,"kind":4,"name":"RecordingMode","url":"enums/recordingmode.html","classes":"tsd-kind-enum"},{"id":14,"kind":16,"name":"ALWAYS","url":"enums/recordingmode.html#always","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"RecordingMode"},{"id":15,"kind":16,"name":"MANUAL","url":"enums/recordingmode.html#manual","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"RecordingMode"},{"id":16,"kind":256,"name":"SessionProperties","url":"interfaces/sessionproperties.html","classes":"tsd-kind-interface"},{"id":17,"kind":1024,"name":"mediaMode","url":"interfaces/sessionproperties.html#mediamode","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SessionProperties"},{"id":18,"kind":1024,"name":"recordingMode","url":"interfaces/sessionproperties.html#recordingmode","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SessionProperties"},{"id":19,"kind":1024,"name":"defaultRecordingLayout","url":"interfaces/sessionproperties.html#defaultrecordinglayout","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SessionProperties"},{"id":20,"kind":1024,"name":"defaultCustomLayout","url":"interfaces/sessionproperties.html#defaultcustomlayout","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"SessionProperties"},{"id":21,"kind":256,"name":"TokenOptions","url":"interfaces/tokenoptions.html","classes":"tsd-kind-interface"},{"id":22,"kind":1024,"name":"data","url":"interfaces/tokenoptions.html#data","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"TokenOptions"},{"id":23,"kind":1024,"name":"role","url":"interfaces/tokenoptions.html#role","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"TokenOptions"},{"id":24,"kind":128,"name":"Session","url":"classes/session.html","classes":"tsd-kind-class"},{"id":25,"kind":1024,"name":"sessionId","url":"classes/session.html#sessionid","classes":"tsd-kind-property tsd-parent-kind-class","parent":"Session"},{"id":26,"kind":1024,"name":"properties","url":"classes/session.html#properties","classes":"tsd-kind-property tsd-parent-kind-class","parent":"Session"},{"id":27,"kind":512,"name":"constructor","url":"classes/session.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"Session"},{"id":28,"kind":2048,"name":"getSessionId","url":"classes/session.html#getsessionid","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Session"},{"id":29,"kind":2048,"name":"generateToken","url":"classes/session.html#generatetoken","classes":"tsd-kind-method tsd-parent-kind-class","parent":"Session"},{"id":30,"kind":32,"name":"Buffer","url":"index.html#buffer","classes":"tsd-kind-variable tsd-is-not-exported"},{"id":31,"kind":32,"name":"require","url":"index.html#require","classes":"tsd-kind-variable tsd-is-not-exported"},{"id":32,"kind":32,"name":"https","url":"index.html#https","classes":"tsd-kind-variable tsd-is-not-exported"},{"id":33,"kind":128,"name":"Recording","url":"classes/recording.html","classes":"tsd-kind-class"},{"id":34,"kind":1024,"name":"id","url":"classes/recording.html#id","classes":"tsd-kind-property tsd-parent-kind-class","parent":"Recording"},{"id":35,"kind":1024,"name":"sessionId","url":"classes/recording.html#sessionid","classes":"tsd-kind-property tsd-parent-kind-class","parent":"Recording"},{"id":36,"kind":1024,"name":"createdAt","url":"classes/recording.html#createdat","classes":"tsd-kind-property tsd-parent-kind-class","parent":"Recording"},{"id":37,"kind":1024,"name":"size","url":"classes/recording.html#size","classes":"tsd-kind-property tsd-parent-kind-class","parent":"Recording"},{"id":38,"kind":1024,"name":"duration","url":"classes/recording.html#duration","classes":"tsd-kind-property tsd-parent-kind-class","parent":"Recording"},{"id":39,"kind":1024,"name":"url","url":"classes/recording.html#url","classes":"tsd-kind-property tsd-parent-kind-class","parent":"Recording"},{"id":40,"kind":1024,"name":"hasAudio","url":"classes/recording.html#hasaudio","classes":"tsd-kind-property tsd-parent-kind-class","parent":"Recording"},{"id":41,"kind":1024,"name":"hasVideo","url":"classes/recording.html#hasvideo","classes":"tsd-kind-property tsd-parent-kind-class","parent":"Recording"},{"id":42,"kind":1024,"name":"status","url":"classes/recording.html#status-1","classes":"tsd-kind-property tsd-parent-kind-class","parent":"Recording"},{"id":43,"kind":1024,"name":"name","url":"classes/recording.html#name","classes":"tsd-kind-property tsd-parent-kind-class","parent":"Recording"},{"id":44,"kind":1024,"name":"recordingLayout","url":"classes/recording.html#recordinglayout","classes":"tsd-kind-property tsd-parent-kind-class","parent":"Recording"},{"id":45,"kind":512,"name":"constructor","url":"classes/recording.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"Recording"},{"id":46,"kind":4,"name":"Status","url":"enums/recording.status.html","classes":"tsd-kind-enum tsd-parent-kind-class tsd-is-static","parent":"Recording"},{"id":47,"kind":16,"name":"starting","url":"enums/recording.status.html#starting","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"Recording.Status"},{"id":48,"kind":16,"name":"started","url":"enums/recording.status.html#started","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"Recording.Status"},{"id":49,"kind":16,"name":"stopped","url":"enums/recording.status.html#stopped","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"Recording.Status"},{"id":50,"kind":16,"name":"available","url":"enums/recording.status.html#available","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"Recording.Status"},{"id":51,"kind":16,"name":"failed","url":"enums/recording.status.html#failed","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"Recording.Status"},{"id":52,"kind":256,"name":"RecordingProperties","url":"interfaces/recordingproperties.html","classes":"tsd-kind-interface"},{"id":53,"kind":1024,"name":"name","url":"interfaces/recordingproperties.html#name","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"RecordingProperties"},{"id":54,"kind":1024,"name":"recordingLayout","url":"interfaces/recordingproperties.html#recordinglayout","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"RecordingProperties"},{"id":55,"kind":1024,"name":"customLayout","url":"interfaces/recordingproperties.html#customlayout","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"RecordingProperties"},{"id":56,"kind":128,"name":"OpenVidu","url":"classes/openvidu.html","classes":"tsd-kind-class"},{"id":57,"kind":512,"name":"constructor","url":"classes/openvidu.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"OpenVidu"},{"id":58,"kind":2048,"name":"createSession","url":"classes/openvidu.html#createsession","classes":"tsd-kind-method tsd-parent-kind-class","parent":"OpenVidu"},{"id":59,"kind":2048,"name":"startRecording","url":"classes/openvidu.html#startrecording","classes":"tsd-kind-method tsd-parent-kind-class","parent":"OpenVidu"},{"id":60,"kind":2048,"name":"stopRecording","url":"classes/openvidu.html#stoprecording","classes":"tsd-kind-method tsd-parent-kind-class","parent":"OpenVidu"},{"id":61,"kind":2048,"name":"getRecording","url":"classes/openvidu.html#getrecording","classes":"tsd-kind-method tsd-parent-kind-class","parent":"OpenVidu"},{"id":62,"kind":2048,"name":"listRecordings","url":"classes/openvidu.html#listrecordings","classes":"tsd-kind-method tsd-parent-kind-class","parent":"OpenVidu"},{"id":63,"kind":2048,"name":"deleteRecording","url":"classes/openvidu.html#deleterecording","classes":"tsd-kind-method tsd-parent-kind-class","parent":"OpenVidu"}]}; \ No newline at end of file diff --git a/openvidu-node-client/docs/classes/openvidu.html b/openvidu-node-client/docs/classes/openvidu.html index 6f3eb8a7..a2d8e460 100644 --- a/openvidu-node-client/docs/classes/openvidu.html +++ b/openvidu-node-client/docs/classes/openvidu.html @@ -3,7 +3,7 @@ - OpenVidu | OpenVidu Browser + OpenVidu | OpenVidu Node Client @@ -22,7 +22,7 @@
  • Preparing search index...
  • The search index is not available
  • - OpenVidu Browser + OpenVidu Node Client
    @@ -51,7 +51,7 @@
    • - Globals + Globals
    • OpenVidu @@ -108,16 +108,28 @@
    • +
      +

      Parameters

      • urlOpenViduServer: string
        +
        +
        +

        Public accessible IP where your instance of OpenVidu Server is up an running

        +
        +
      • secret: string
        +
        +
        +

        Secret used on OpenVidu Server initialization

        +
        +

      Returns OpenVidu

      @@ -137,7 +149,7 @@
    • Parameters

      @@ -160,16 +172,28 @@
    • +
      +
      +

      Deletes a Recording. The recording must have status stopped or available

      +
      +

      Parameters

      • recordingId: string
        +
        +

      Returns Promise<Error>

      +

      A Promise that is resolved if the Recording was successfully deleted and rejected with an Error object if not. This Error object has as message property with the following values:

      +
        +
      • 404: no recording exists for the passed recordingId
      • +
      • 409: the recording has started status. Stop it before deletion
      • +
    @@ -183,16 +207,28 @@
  • +
    +
    +

    Gets an existing Recording

    +
    +

    Parameters

    • recordingId: string
      +
      +

      The id property of the Recording you want to retrieve

      +

    Returns Promise<Recording>

    +

    A Promise that is resolved to the Recording if it successfully stopped and rejected with an Error object if not. This Error object has as message property with the following values:

    +
      +
    • 404: no recording exists for the passed recordingId
    • +
  • @@ -206,10 +242,16 @@
  • +
    +
    +

    Lists all existing recordings

    +
    +

    Returns Promise<Recording[]>

    +

    A Promise that is resolved to an array with all existing recordings

  • @@ -225,50 +267,103 @@
  • +
    +
    +

    Starts the recording of a Session

    +
    +

    Parameters

    • sessionId: string
      +
      +
      +

      The sessionId of the Session you want to start recording

      +
      +

    Returns Promise<Recording>

    +

    A Promise that is resolved to the Recording if it successfully started and rejected with an Error object if not. This Error object has as message property with the following values:

    +
      +
    • 404: no session exists for the passed sessionId
    • +
    • 400: the session has no connected participants
    • +
    • 409: the session is not configured for using MediaMode.ROUTED or it is already being recorded
    • +
  • +
    +
    +

    Starts the recording of a Session

    +
    +

    Parameters

    • sessionId: string
      +
      +
      +

      The sessionId of the Session you want to start recording

      +
      +
    • name: string
      +
      +
      +

      The name you want to give to the video file. You can access this same value in your clients on recording events (recordingStarted, recordingStopped)

      +
      +

    Returns Promise<Recording>

    +

    A Promise that is resolved to the Recording if it successfully started and rejected with an Error object if not. This Error object has as message property with the following values:

    +
      +
    • 404: no session exists for the passed sessionId
    • +
    • 400: the session has no connected participants
    • +
    • 409: the session is not configured for using MediaMode.ROUTED or it is already being recorded
    • +
  • +
    +
    +

    Starts the recording of a Session

    +
    +

    Parameters

    Returns Promise<Recording>

    +

    A Promise that is resolved to the Recording if it successfully started and rejected with an Error object if not. This Error object has as message property with the following values:

    +
      +
    • 404: no session exists for the passed sessionId
    • +
    • 400: the session has no connected participants
    • +
    • 409: the session is not configured for using MediaMode.ROUTED or it is already being recorded
    • +
  • @@ -282,16 +377,29 @@
  • +
    +
    +

    Stops the recording of a Session

    +
    +

    Parameters

    • recordingId: string
      +
      +

      The id property of the Recording you want to stop

      +

    Returns Promise<Recording>

    +

    A Promise that is resolved to the Recording if it successfully stopped and rejected with an Error object if not. This Error object has as message property with the following values:

    +
      +
    • 404: no recording exists for the passed recordingId
    • +
    • 406: recording has starting status. Wait until started status before stopping the recording
    • +
  • @@ -301,7 +409,7 @@ @@ -365,13 +473,13 @@ TokenOptions
  • - Buffer + Buffer
  • - https + https
  • - require + require
  • diff --git a/openvidu-node-client/docs/classes/recording.html b/openvidu-node-client/docs/classes/recording.html index 2b1ef2e8..66e9a492 100644 --- a/openvidu-node-client/docs/classes/recording.html +++ b/openvidu-node-client/docs/classes/recording.html @@ -3,7 +3,7 @@ - Recording | OpenVidu Browser + Recording | OpenVidu Node Client @@ -22,7 +22,7 @@
  • Preparing search index...
  • The search index is not available
  • - OpenVidu Browser + OpenVidu Node Client
    @@ -51,7 +51,7 @@ @@ -119,7 +119,7 @@
  • Parameters

    @@ -134,193 +134,171 @@
    -

    Methods

    -
    - -

    getCreatedAt

    -
      -
    • getCreatedAt(): number
    • -
    - +

    Properties

    +
    + +

    createdAt

    +
    createdAt: number
    + +
    +
    +

    Time when the recording started in UTC milliseconds

    +
    +
    -
    - -

    getDuration

    -
      -
    • getDuration(): number
    • -
    - +
    + +

    duration

    +
    duration: number = 0
    + +
    +
    +

    Duration of the recording in seconds (0 until the recording is stopped)

    +
    +
    -
    - -

    getId

    -
      -
    • getId(): string
    • -
    - -
    -
    - -

    getLayout

    - - -
    -
    - -

    getName

    -
      -
    • getName(): string
    • -
    - -
    -
    - -

    getSessionId

    -
      -
    • getSessionId(): string
    • -
    - -
    -
    - -

    getSize

    -
      -
    • getSize(): number
    • -
    - -
    -
    - -

    getStatus

    - - -
    -
    - -

    getUrl

    -
      -
    • getUrl(): string
    • -
    - -
    -
    +

    hasAudio

    -
      -
    • hasAudio(): boolean
    • -
    - +
    hasAudio: boolean = true
    + +
    +
    +

    true if the recording has an audio track, false otherwise (currently fixed to true)

    +
    +
    -
    +

    hasVideo

    -
      -
    • hasVideo(): boolean
    • -
    - +
    hasVideo: boolean = true
    + +
    +
    +

    true if the recording has a video track, false otherwise (currently fixed to true)

    +
    +
    +
    +
    + +

    id

    +
    id: string
    + +
    +
    +

    Recording unique identifier

    +
    +
    +
    +
    + +

    name

    +
    name: string
    + +
    +
    +

    Name of the Recording. The video file will be named after this property

    +
    +
    +
    +
    + +

    recordingLayout

    +
    recordingLayout: RecordingLayout
    + +
    +
    +

    The layout used in this Recording

    +
    +
    +
    +
    + +

    sessionId

    +
    sessionId: string
    + +
    +
    +

    Session associated to the recording

    +
    +
    +
    +
    + +

    size

    +
    size: number = 0
    + +
    +
    +

    Size of the recording in bytes (0 until the recording is stopped)

    +
    +
    +
    +
    + +

    status

    +
    status: Status
    + +
    +
    +

    Status of the recording

    +
    +
    +
    +
    + +

    url

    +
    url: string
    + +
    +
    +

    URL of the recording. You can access the file from there. It is null until recording is stopped or if OpenVidu Server configuration property openvidu.recording.public-access is false

    +
    +
  • @@ -328,7 +306,7 @@ @@ -360,39 +338,39 @@
  • constructor
  • -
  • - getCreatedAt +
  • + createdAt
  • -
  • - getDuration +
  • + duration
  • -
  • - getId -
  • -
  • - getLayout -
  • -
  • - getName -
  • -
  • - getSessionId -
  • -
  • - getSize -
  • -
  • - getStatus -
  • -
  • - getUrl -
  • -
  • +
  • hasAudio
  • -
  • +
  • hasVideo
  • +
  • + id +
  • +
  • + name +
  • +
  • + recordingLayout +
  • +
  • + sessionId +
  • +
  • + size +
  • +
  • + status +
  • +
  • + url +
  • @@ -410,13 +388,13 @@ TokenOptions
  • - Buffer + Buffer
  • - https + https
  • - require + require
  • diff --git a/openvidu-node-client/docs/classes/session.html b/openvidu-node-client/docs/classes/session.html index fadef68d..b9dfef14 100644 --- a/openvidu-node-client/docs/classes/session.html +++ b/openvidu-node-client/docs/classes/session.html @@ -3,7 +3,7 @@ - Session | OpenVidu Browser + Session | OpenVidu Node Client @@ -22,7 +22,7 @@
  • Preparing search index...
  • The search index is not available
  • - OpenVidu Browser + OpenVidu Node Client
    @@ -51,7 +51,7 @@
    +
    +

    Properties

    + +

    Methods

    @@ -105,7 +111,7 @@
  • Parameters

    @@ -128,6 +134,29 @@ +
    +

    Properties

    +
    + +

    properties

    +
    properties: SessionProperties
    + +
    +
    + +

    sessionId

    +
    sessionId: string
    + +
    +

    Methods

    @@ -140,9 +169,14 @@
  • +
    +
    +

    Gets a new token associated to Session object. This translates into a new request to OpenVidu Server

    +
    +

    Parameters

    • @@ -150,23 +184,7 @@

    Returns Promise<string>

    -
  • - -
    -
    - -

    getProperties

    - -
      -
    • - -

      Returns SessionProperties

      +

      A Promise that is resolved to the token if success and rejected with an Error object if not (due to a 400 (Bad Request) error in OpenVidu Server)

    @@ -180,10 +198,17 @@
  • +
    +
    +

    Gets the unique identifier of the Session. This translates into a new request to OpenVidu Server if this Session has no sessionId yet + or simply returns the existing value if it has already been retrieved

    +
    +

    Returns Promise<string>

    +

    A Promise that is resolved to the sessionId if success and rejected with an Error object if not (due to a 400 (Bad Request) error in OpenVidu Server)

  • @@ -193,7 +218,7 @@ @@ -225,11 +250,14 @@
  • constructor
  • -
  • - generateToken +
  • + properties +
  • +
  • + sessionId
  • - getProperties + generateToken
  • getSessionId @@ -248,13 +276,13 @@ TokenOptions
  • - Buffer + Buffer
  • - https + https
  • - require + require
  • diff --git a/openvidu-node-client/docs/enums/mediamode.html b/openvidu-node-client/docs/enums/mediamode.html index 429d2ec9..1d813c31 100644 --- a/openvidu-node-client/docs/enums/mediamode.html +++ b/openvidu-node-client/docs/enums/mediamode.html @@ -3,7 +3,7 @@ - MediaMode | OpenVidu Browser + MediaMode | OpenVidu Node Client @@ -22,7 +22,7 @@
  • Preparing search index...
  • The search index is not available
  • - OpenVidu Browser + OpenVidu Node Client
    @@ -51,7 +51,7 @@
    @@ -106,7 +116,7 @@ @@ -155,13 +165,13 @@ TokenOptions
  • - Buffer + Buffer
  • - https + https
  • - require + require
  • diff --git a/openvidu-node-client/docs/enums/openvidurole.html b/openvidu-node-client/docs/enums/openvidurole.html index 568c2fba..7a488e77 100644 --- a/openvidu-node-client/docs/enums/openvidurole.html +++ b/openvidu-node-client/docs/enums/openvidurole.html @@ -3,7 +3,7 @@ - OpenViduRole | OpenVidu Browser + OpenViduRole | OpenVidu Node Client @@ -22,7 +22,7 @@
  • Preparing search index...
  • The search index is not available
  • - OpenVidu Browser + OpenVidu Node Client
    @@ -51,7 +51,7 @@
    @@ -117,7 +132,7 @@ @@ -169,13 +184,13 @@ TokenOptions
  • - Buffer + Buffer
  • - https + https
  • - require + require
  • diff --git a/openvidu-node-client/docs/enums/recording.status.html b/openvidu-node-client/docs/enums/recording.status.html index d9a15507..72b18cb2 100644 --- a/openvidu-node-client/docs/enums/recording.status.html +++ b/openvidu-node-client/docs/enums/recording.status.html @@ -3,7 +3,7 @@ - Status | OpenVidu Browser + Status | OpenVidu Node Client @@ -22,7 +22,7 @@
  • Preparing search index...
  • The search index is not available
  • - OpenVidu Browser + OpenVidu Node Client
    @@ -51,7 +51,7 @@
    @@ -241,13 +241,13 @@ TokenOptions
  • - Buffer + Buffer
  • - https + https
  • - require + require
  • diff --git a/openvidu-node-client/docs/enums/recordinglayout.html b/openvidu-node-client/docs/enums/recordinglayout.html index 23f0651e..b852402d 100644 --- a/openvidu-node-client/docs/enums/recordinglayout.html +++ b/openvidu-node-client/docs/enums/recordinglayout.html @@ -3,7 +3,7 @@ - RecordingLayout | OpenVidu Browser + RecordingLayout | OpenVidu Node Client @@ -22,7 +22,7 @@
  • Preparing search index...
  • The search index is not available
  • - OpenVidu Browser + OpenVidu Node Client
    @@ -51,7 +51,7 @@
    @@ -139,7 +164,7 @@ @@ -197,13 +222,13 @@ TokenOptions
  • - Buffer + Buffer
  • - https + https
  • - require + require
  • diff --git a/openvidu-node-client/docs/enums/recordingmode.html b/openvidu-node-client/docs/enums/recordingmode.html index baa4c958..62474622 100644 --- a/openvidu-node-client/docs/enums/recordingmode.html +++ b/openvidu-node-client/docs/enums/recordingmode.html @@ -3,7 +3,7 @@ - RecordingMode | OpenVidu Browser + RecordingMode | OpenVidu Node Client @@ -22,7 +22,7 @@
  • Preparing search index...
  • The search index is not available
  • - OpenVidu Browser + OpenVidu Node Client
    @@ -51,7 +51,7 @@
    @@ -106,7 +118,7 @@ @@ -155,13 +167,13 @@ TokenOptions
  • - Buffer + Buffer
  • - https + https
  • - require + require
  • diff --git a/openvidu-node-client/docs/globals.html b/openvidu-node-client/docs/globals.html deleted file mode 100644 index 71676c96..00000000 --- a/openvidu-node-client/docs/globals.html +++ /dev/null @@ -1,260 +0,0 @@ - - - - - - OpenVidu Browser - - - - - -
    -
    -
    -
    - -
    -
    - Options -
    -
    - All -
      -
    • Public
    • -
    • Public/Protected
    • -
    • All
    • -
    -
    - - - - -
    -
    - Menu -
    -
    -
    -
    -
    -
    - -

    OpenVidu Browser

    -
    -
    -
    -
    -
    -
    -
    -

    Index

    -
    -
    -
    -

    Enumerations

    - -
    -
    -

    Classes

    - -
    -
    -

    Interfaces

    - -
    -
    -

    Variables

    - -
    -
    -
    -
    -
    -

    Variables

    -
    - -

    Const Buffer

    -
    Buffer: any
    - -
    -
    - -

    Let https

    -
    https: any = require('https')
    - -
    -
    - -

    Const require

    -
    require: any
    - -
    -
    -
    - -
    -
    -
    -
    -

    Legend

    -
    -
      -
    • Module
    • -
    • Object literal
    • -
    • Variable
    • -
    • Function
    • -
    • Function with type parameter
    • -
    • Index signature
    • -
    • Type alias
    • -
    -
      -
    • Enumeration
    • -
    • Enumeration member
    • -
    • Property
    • -
    • Method
    • -
    -
      -
    • Interface
    • -
    • Interface with type parameter
    • -
    • Constructor
    • -
    • Property
    • -
    • Method
    • -
    • Index signature
    • -
    -
      -
    • Class
    • -
    • Class with type parameter
    • -
    • Constructor
    • -
    • Property
    • -
    • Method
    • -
    • Accessor
    • -
    • Index signature
    • -
    -
      -
    • Inherited constructor
    • -
    • Inherited property
    • -
    • Inherited method
    • -
    • Inherited accessor
    • -
    -
      -
    • Protected property
    • -
    • Protected method
    • -
    • Protected accessor
    • -
    -
      -
    • Private property
    • -
    • Private method
    • -
    • Private accessor
    • -
    -
      -
    • Static property
    • -
    • Static method
    • -
    -
    -
    -
    -
    -

    Generated using TypeDoc

    -
    -
    - - - - \ No newline at end of file diff --git a/openvidu-node-client/docs/index.html b/openvidu-node-client/docs/index.html index defa3a97..7e5b9c52 100644 --- a/openvidu-node-client/docs/index.html +++ b/openvidu-node-client/docs/index.html @@ -3,7 +3,7 @@ - OpenVidu Browser + OpenVidu Node Client @@ -22,7 +22,7 @@
  • Preparing search index...
  • The search index is not available
  • - OpenVidu Browser + OpenVidu Node Client
    @@ -51,37 +51,97 @@
    -

    OpenVidu Browser

    +

    OpenVidu Node Client

    -
    -

    License badge - Documentation badge - Support badge

    -

    -

    openvidu-node-client

    -
      -
    • Description: Library for your NODE server. It makes easier the retrieval of the necessary params from OpenVidu Server for securing your application (sessionId's and token's). It is a simple alternative to the REST API.

      -
    • -
    • Docs: openvidu-node-client API

      -
    • -
    • Release: OpenVidu Artifacts

      -
    • -
    -
    +
    +

    Index

    +
    +
    +
    +

    Enumerations

    + +
    +
    +

    Classes

    + +
    +
    +

    Interfaces

    + +
    +
    +

    Variables

    + +
    +
    +
    +
    +
    +

    Variables

    +
    + +

    Const Buffer

    +
    Buffer: any
    + +
    +
    + +

    Const https

    +
    https: any = require('https')
    + +
    +
    + +

    Const require

    +
    require: any
    + +
    +
    @@ -51,7 +51,7 @@
    @@ -125,7 +141,7 @@ @@ -177,13 +193,13 @@ TokenOptions
  • - Buffer + Buffer
  • - https + https
  • - require + require
  • diff --git a/openvidu-node-client/docs/interfaces/sessionproperties.html b/openvidu-node-client/docs/interfaces/sessionproperties.html index 61d6f8e7..dea71d6a 100644 --- a/openvidu-node-client/docs/interfaces/sessionproperties.html +++ b/openvidu-node-client/docs/interfaces/sessionproperties.html @@ -3,7 +3,7 @@ - SessionProperties | OpenVidu Browser + SessionProperties | OpenVidu Node Client @@ -22,7 +22,7 @@
  • Preparing search index...
  • The search index is not available
  • - OpenVidu Browser + OpenVidu Node Client
    @@ -51,7 +51,7 @@
    diff --git a/openvidu-node-client/docs/interfaces/tokenoptions.html b/openvidu-node-client/docs/interfaces/tokenoptions.html index 5472edf9..92e52874 100644 --- a/openvidu-node-client/docs/interfaces/tokenoptions.html +++ b/openvidu-node-client/docs/interfaces/tokenoptions.html @@ -3,7 +3,7 @@ - TokenOptions | OpenVidu Browser + TokenOptions | OpenVidu Node Client @@ -22,7 +22,7 @@
  • Preparing search index...
  • The search index is not available
  • - OpenVidu Browser + OpenVidu Node Client
    @@ -51,7 +51,7 @@
    • - Globals + Globals
    • TokenOptions @@ -94,9 +94,19 @@
      data: string
      +
      +
      +

      Secure (server-side) data associated to this token. Every client will receive this data in property Connection.data. Object Connection can be retrieved by subscribing to event connectionCreated of Session object.

      +
        +
      • If you have provided no data in your clients when calling method Session.connect(TOKEN, DATA) (DATA not defined), then Connection.data will only have this TokenOptions.data property.
      • +
      • If you have provided some data when calling Session.connect(TOKEN, DATA) (DATA defined), then Connection.data will have the following structure: "CLIENT_DATA%/%SERVER_DATA", being CLIENT_DATA the second + parameter passed in OpenVidu Browser in method Session.connect and SERVER_DATA this TokenOptions.data property.
      • +
      +
      +
      @@ -104,7 +114,7 @@
      @@ -114,7 +124,7 @@ @@ -163,13 +173,13 @@
    diff --git a/openvidu-node-client/lib/OpenVidu.d.ts b/openvidu-node-client/lib/OpenVidu.d.ts index 20ce14c6..526ef11d 100644 --- a/openvidu-node-client/lib/OpenVidu.d.ts +++ b/openvidu-node-client/lib/OpenVidu.d.ts @@ -10,14 +10,49 @@ export declare class OpenVidu { private hostname; private port; private basicAuth; + /** + * @param urlOpenViduServer Public accessible IP where your instance of OpenVidu Server is up an running + * @param secret Secret used on OpenVidu Server initialization + */ constructor(urlOpenViduServer: string, secret: string); createSession(properties?: SessionProperties): Session; startRecording(sessionId: string): Promise; startRecording(sessionId: string, name: string): Promise; startRecording(sessionId: string, properties: RecordingProperties): Promise; + /** + * Stops the recording of a [[Session]] + * + * @param recordingId The `id` property of the [[Recording]] you want to stop + * + * @returns A Promise that is resolved to the [[Recording]] if it successfully stopped and rejected with an Error object if not. This Error object has as `message` property with the following values: + * - `404`: no recording exists for the passed `recordingId` + * - `406`: recording has `starting` status. Wait until `started` status before stopping the recording + */ stopRecording(recordingId: string): Promise; + /** + * Gets an existing [[Recording]] + * + * @param recordingId The `id` property of the [[Recording]] you want to retrieve + * + * @returns A Promise that is resolved to the [[Recording]] if it successfully stopped and rejected with an Error object if not. This Error object has as `message` property with the following values: + * - `404`: no recording exists for the passed `recordingId` + */ getRecording(recordingId: string): Promise; + /** + * Lists all existing recordings + * + * @returns A Promise that is resolved to an array with all existing recordings + */ listRecordings(): Promise; + /** + * Deletes a [[Recording]]. The recording must have status `stopped` or `available` + * + * @param recordingId + * + * @returns A Promise that is resolved if the Recording was successfully deleted and rejected with an Error object if not. This Error object has as `message` property with the following values: + * - `404`: no recording exists for the passed `recordingId` + * - `409`: the recording has `started` status. Stop it before deletion + */ deleteRecording(recordingId: string): Promise; private getBasicAuth(secret); private setHostnameAndPort(); diff --git a/openvidu-node-client/lib/OpenVidu.js b/openvidu-node-client/lib/OpenVidu.js index c94dadb3..d7f375ae 100644 --- a/openvidu-node-client/lib/OpenVidu.js +++ b/openvidu-node-client/lib/OpenVidu.js @@ -20,6 +20,10 @@ var Session_1 = require("./Session"); var Recording_1 = require("./Recording"); var https = require('https'); var OpenVidu = /** @class */ (function () { + /** + * @param urlOpenViduServer Public accessible IP where your instance of OpenVidu Server is up an running + * @param secret Secret used on OpenVidu Server initialization + */ function OpenVidu(urlOpenViduServer, secret) { this.urlOpenViduServer = urlOpenViduServer; this.setHostnameAndPort(); @@ -28,6 +32,17 @@ var OpenVidu = /** @class */ (function () { OpenVidu.prototype.createSession = function (properties) { return new Session_1.Session(this.hostname, this.port, this.basicAuth, properties); }; + /** + * Starts the recording of a [[Session]] + * + * @param sessionId The `sessionId` of the [[Session]] you want to start recording + * @param name The name you want to give to the video file. You can access this same value in your clients on recording events (`recordingStarted`, `recordingStopped`) + * + * @returns A Promise that is resolved to the [[Recording]] if it successfully started and rejected with an Error object if not. This Error object has as `message` property with the following values: + * - `404`: no session exists for the passed `sessionId` + * - `400`: the session has no connected participants + * - `409`: the session is not configured for using [[MediaMode.ROUTED]] or it is already being recorded + */ OpenVidu.prototype.startRecording = function (sessionId, param2) { var _this = this; return new Promise(function (resolve, reject) { @@ -94,6 +109,15 @@ var OpenVidu = /** @class */ (function () { req.end(); }); }; + /** + * Stops the recording of a [[Session]] + * + * @param recordingId The `id` property of the [[Recording]] you want to stop + * + * @returns A Promise that is resolved to the [[Recording]] if it successfully stopped and rejected with an Error object if not. This Error object has as `message` property with the following values: + * - `404`: no recording exists for the passed `recordingId` + * - `406`: recording has `starting` status. Wait until `started` status before stopping the recording + */ OpenVidu.prototype.stopRecording = function (recordingId) { var _this = this; return new Promise(function (resolve, reject) { @@ -131,6 +155,14 @@ var OpenVidu = /** @class */ (function () { req.end(); }); }; + /** + * Gets an existing [[Recording]] + * + * @param recordingId The `id` property of the [[Recording]] you want to retrieve + * + * @returns A Promise that is resolved to the [[Recording]] if it successfully stopped and rejected with an Error object if not. This Error object has as `message` property with the following values: + * - `404`: no recording exists for the passed `recordingId` + */ OpenVidu.prototype.getRecording = function (recordingId) { var _this = this; return new Promise(function (resolve, reject) { @@ -168,6 +200,11 @@ var OpenVidu = /** @class */ (function () { req.end(); }); }; + /** + * Lists all existing recordings + * + * @returns A Promise that is resolved to an array with all existing recordings + */ OpenVidu.prototype.listRecordings = function () { var _this = this; return new Promise(function (resolve, reject) { @@ -211,6 +248,15 @@ var OpenVidu = /** @class */ (function () { req.end(); }); }; + /** + * Deletes a [[Recording]]. The recording must have status `stopped` or `available` + * + * @param recordingId + * + * @returns A Promise that is resolved if the Recording was successfully deleted and rejected with an Error object if not. This Error object has as `message` property with the following values: + * - `404`: no recording exists for the passed `recordingId` + * - `409`: the recording has `started` status. Stop it before deletion + */ OpenVidu.prototype.deleteRecording = function (recordingId) { var _this = this; return new Promise(function (resolve, reject) { diff --git a/openvidu-node-client/lib/OpenVidu.js.map b/openvidu-node-client/lib/OpenVidu.js.map index 5bb75245..e846dd08 100644 --- a/openvidu-node-client/lib/OpenVidu.js.map +++ b/openvidu-node-client/lib/OpenVidu.js.map @@ -1 +1 @@ -{"version":3,"file":"OpenVidu.js","sourceRoot":"","sources":["../src/OpenVidu.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;AAEH,qCAAoC;AAEpC,yCAAwC;AAKxC,IAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAE/B;IAUE,kBAAoB,iBAAyB,EAAE,MAAc;QAAzC,sBAAiB,GAAjB,iBAAiB,CAAQ;QAC3C,IAAI,CAAC,kBAAkB,E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AQ,GAAG,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YACxE,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;QAChF,CAAC;QAAC,IAAI,CAAC,CAAC;YACN,OAAO,CAAC,KAAK,CAAC,2EAA2E,GAAG,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;QAC7H,CAAC;IACH,CAAC;IA5TuB,uBAAc,GAAW,iBAAiB,CAAC;IAC3C,6BAAoB,GAAW,QAAQ,CAAC;IACxC,4BAAmB,GAAW,OAAO,CAAC;IA4ThE,eAAC;CAAA,AAhUD,IAgUC;AAhUY,4BAAQ"} \ No newline at end of file diff --git a/openvidu-node-client/lib/OpenViduRole.d.ts b/openvidu-node-client/lib/OpenViduRole.d.ts index 77cc2851..fd4132ae 100644 --- a/openvidu-node-client/lib/OpenViduRole.d.ts +++ b/openvidu-node-client/lib/OpenViduRole.d.ts @@ -1,5 +1,14 @@ export declare enum OpenViduRole { + /** + * Can subscribe to published streams of other users + */ SUBSCRIBER = "SUBSCRIBER", + /** + * SUBSCRIBER permissions + can publish their own streams + */ PUBLISHER = "PUBLISHER", + /** + * _(not available yet)_ SUBSCRIBER + PUBLIHSER permissions + can force `unpublish()` and `disconnect()` over a third-party stream or user + */ MODERATOR = "MODERATOR", } diff --git a/openvidu-node-client/lib/OpenViduRole.js b/openvidu-node-client/lib/OpenViduRole.js index 2f67d5ef..1a0ff067 100644 --- a/openvidu-node-client/lib/OpenViduRole.js +++ b/openvidu-node-client/lib/OpenViduRole.js @@ -18,8 +18,17 @@ Object.defineProperty(exports, "__esModule", { value: true }); var OpenViduRole; (function (OpenViduRole) { + /** + * Can subscribe to published streams of other users + */ OpenViduRole["SUBSCRIBER"] = "SUBSCRIBER"; + /** + * SUBSCRIBER permissions + can publish their own streams + */ OpenViduRole["PUBLISHER"] = "PUBLISHER"; + /** + * _(not available yet)_ SUBSCRIBER + PUBLIHSER permissions + can force `unpublish()` and `disconnect()` over a third-party stream or user + */ OpenViduRole["MODERATOR"] = "MODERATOR"; })(OpenViduRole = exports.OpenViduRole || (exports.OpenViduRole = {})); //# sourceMappingURL=OpenViduRole.js.map \ No newline at end of file diff --git a/openvidu-node-client/lib/OpenViduRole.js.map b/openvidu-node-client/lib/OpenViduRole.js.map index 8bfa043d..6ee16e8f 100644 --- a/openvidu-node-client/lib/OpenViduRole.js.map +++ b/openvidu-node-client/lib/OpenViduRole.js.map @@ -1 +1 @@ -{"version":3,"file":"OpenViduRole.js","sourceRoot":"","sources":["../src/OpenViduRole.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;AAEH,IAAY,YAIX;AAJD,WAAY,YAAY;IACvB,yCAAyB,CAAA;IACzB,uCAAuB,CAAA;IACvB,uCAAuB,CAAA;AACxB,CAAC,EAJW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAIvB"} \ No newline at end of file +{"version":3,"file":"OpenViduRole.js","sourceRoot":"","sources":["../src/OpenViduRole.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;AAEH,IAAY,YAgBX;AAhBD,WAAY,YAAY;IAEvB;;OAEG;IACH,yCAAyB,CAAA;IAEzB;;OAEG;IACH,uCAAuB,CAAA;IAEvB;;OAEG;IACH,uCAAuB,CAAA;AACxB,CAAC,EAhBW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAgBvB"} \ No newline at end of file diff --git a/openvidu-node-client/lib/Session.d.ts b/openvidu-node-client/lib/Session.d.ts index 506df0e9..e3545488 100644 --- a/openvidu-node-client/lib/Session.d.ts +++ b/openvidu-node-client/lib/Session.d.ts @@ -6,10 +6,20 @@ export declare class Session { private basicAuth; private static readonly API_SESSIONS; private static readonly API_TOKENS; - private sessionId; - private properties; + sessionId: string; + properties: SessionProperties; constructor(hostname: string, port: number, basicAuth: string, properties?: SessionProperties); + /** + * Gets the unique identifier of the Session. This translates into a new request to OpenVidu Server if this Session has no `sessionId` yet + * or simply returns the existing value if it has already been retrieved + * + * @returns A Promise that is resolved to the _sessionId_ if success and rejected with an Error object if not (due to a `400 (Bad Request)` error in OpenVidu Server) + */ getSessionId(): Promise; + /** + * Gets a new token associated to Session object. This translates into a new request to OpenVidu Server + * + * @returns A Promise that is resolved to the _token_ if success and rejected with an Error object if not (due to a `400 (Bad Request)` error in OpenVidu Server) + */ generateToken(tokenOptions?: TokenOptions): Promise; - getProperties(): SessionProperties; } diff --git a/openvidu-node-client/lib/Session.js b/openvidu-node-client/lib/Session.js index 4189df76..585c321a 100644 --- a/openvidu-node-client/lib/Session.js +++ b/openvidu-node-client/lib/Session.js @@ -26,18 +26,23 @@ var Session = /** @class */ (function () { this.hostname = hostname; this.port = port; this.basicAuth = basicAuth; - this.sessionId = ''; - if (properties === null) { + if (!properties) { this.properties = {}; } else { this.properties = properties; } } + /** + * Gets the unique identifier of the Session. This translates into a new request to OpenVidu Server if this Session has no `sessionId` yet + * or simply returns the existing value if it has already been retrieved + * + * @returns A Promise that is resolved to the _sessionId_ if success and rejected with an Error object if not (due to a `400 (Bad Request)` error in OpenVidu Server) + */ Session.prototype.getSessionId = function () { var _this = this; return new Promise(function (resolve, reject) { - if (_this.sessionId) { + if (!!_this.sessionId) { resolve(_this.sessionId); } var requestBody = JSON.stringify({ @@ -83,6 +88,11 @@ var Session = /** @class */ (function () { req.end(); }); }; + /** + * Gets a new token associated to Session object. This translates into a new request to OpenVidu Server + * + * @returns A Promise that is resolved to the _token_ if success and rejected with an Error object if not (due to a `400 (Bad Request)` error in OpenVidu Server) + */ Session.prototype.generateToken = function (tokenOptions) { var _this = this; return new Promise(function (resolve, reject) { @@ -127,9 +137,6 @@ var Session = /** @class */ (function () { req.end(); }); }; - Session.prototype.getProperties = function () { - return this.properties; - }; Session.API_SESSIONS = '/api/sessions'; Session.API_TOKENS = '/api/tokens'; return Session; diff --git a/openvidu-node-client/lib/Session.js.map b/openvidu-node-client/lib/Session.js.map index 765f221c..14712530 100644 --- a/openvidu-node-client/lib/Session.js.map +++ b/openvidu-node-client/lib/Session.js.map @@ -1 +1 @@ -{"version":3,"file":"Session.js","sourceRoot":"","sources":["../src/Session.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;AAEH,yCAAwC;AACxC,+CAA8C;AAC9C,qDAAoD;AACpD,iDAAgD;AAOhD,IAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAE/B;IAQI,iBAAoB,QAAgB,EAAU,IAAY,EAAU,SAAiB,EAAE,UAA8B;QAAjG,aAAQ,GAAR,QAAQ,CAAQ;QAAU,SAAI,GAAJ,IAAI,CAAQ;QAAU,cAAS,GAAT,SAAS,CAAQ;QAH7E,cAAS,GAAG,EAAE,CAAC;QAInB,EAAE,CAAC,CAAC,UAAU,KAAK,IAAI,CAAC,CAAC,CAAC;YACtB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACzB,CAAC;QAAC,IAAI,CAAC,CAAC;YACJ,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QACjC,CAAC;IACL,CAAC;IAEM,8BAAY,GAAnB;QAAA,iBAmDC;QAlDG,MAAM,CAAC,IAAI,OAAO,CAAS,UAAC,OAAO,EAAE,MAAM;YAEvC,EAAE,CAAC,CAAC,KAAI,CAAC,SAAS,CAAC,CAAC,CAAC;gBACjB,OAAO,CAAC,KAAI,CAAC,SAAS,CAAC,CAAC;YAC5B,CAAC;YAED,IAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC;gBAC/B,SAAS,EAAE,CAAC,CAAC,KAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,KAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC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CAAC;gBACH,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE;oBACV,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,KAAK,GAAG,CAAC,CAAC,CAAC;wBACzB,uDAAuD;wBACvD,IAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;wBAChC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;oBACvB,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,2DAA2D;wBAC3D,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;oBACtC,CAAC;gBACL,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;YAEH,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,UAAC,CAAC;gBACd,MAAM,CAAC,CAAC,CAAC,CAAC;YACd,CAAC,CAAC,CAAC;YACH,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;YACvB,GAAG,CAAC,GAAG,EAAE,CAAC;QACd,CAAC,CAAC,CAAC;IACP,CAAC;IA3HuB,oBAAY,GAAG,eAAe,CAAC;IAC/B,kBAAU,GAAG,aAAa,CAAC;IA4HvD,cAAC;CAAA,AA/HD,IA+HC;AA/HY,0BAAO"} \ No newline at end of file diff --git a/openvidu-node-client/lib/TokenOptions.d.ts b/openvidu-node-client/lib/TokenOptions.d.ts index 123f7a7b..625416bf 100644 --- a/openvidu-node-client/lib/TokenOptions.d.ts +++ b/openvidu-node-client/lib/TokenOptions.d.ts @@ -1,5 +1,11 @@ import { OpenViduRole } from './OpenViduRole'; export interface TokenOptions { + /** + * Secure (server-side) data associated to this token. Every client will receive this data in property `Connection.data`. Object `Connection` can be retrieved by subscribing to event `connectionCreated` of Session object. + * - If you have provided no data in your clients when calling method `Session.connect(TOKEN, DATA)` (`DATA` not defined), then `Connection.data` will only have this [[TokenOptions.data]] property. + * - If you have provided some data when calling `Session.connect(TOKEN, DATA)` (`DATA` defined), then `Connection.data` will have the following structure: `"CLIENT_DATA%/%SERVER_DATA"`, being `CLIENT_DATA` the second + * parameter passed in OpenVidu Browser in method `Session.connect` and `SERVER_DATA` this [[TokenOptions.data]] property. + */ data: string; role: OpenViduRole; } diff --git a/openvidu-node-client/src/MediaMode.ts b/openvidu-node-client/src/MediaMode.ts index 7f95ed98..942c38e9 100644 --- a/openvidu-node-client/src/MediaMode.ts +++ b/openvidu-node-client/src/MediaMode.ts @@ -16,6 +16,14 @@ */ export enum MediaMode { - RELAYED = 'RELAYED', // The session will attempt to transmit streams directly between clients - ROUTED = 'ROUTED' // The session will transmit streams using OpenVidu Media Server + + /** + * _(not available yet)_ The session will attempt to transmit streams directly between clients + */ + RELAYED = 'RELAYED', + + /** + * The session will transmit streams using OpenVidu Media Server + */ + ROUTED = 'ROUTED' } diff --git a/openvidu-node-client/src/OpenVidu.ts b/openvidu-node-client/src/OpenVidu.ts index bfdee37d..10f06957 100644 --- a/openvidu-node-client/src/OpenVidu.ts +++ b/openvidu-node-client/src/OpenVidu.ts @@ -34,6 +34,10 @@ export class OpenVidu { private port: number; private basicAuth: string; + /** + * @param urlOpenViduServer Public accessible IP where your instance of OpenVidu Server is up an running + * @param secret Secret used on OpenVidu Server initialization + */ constructor(private urlOpenViduServer: string, secret: string) { this.setHostnameAndPort(); this.basicAuth = this.getBasicAuth(secret); @@ -47,6 +51,17 @@ export class OpenVidu { public startRecording(sessionId: string, name: string): Promise; public startRecording(sessionId: string, properties: RecordingProperties): Promise; + /** + * Starts the recording of a [[Session]] + * + * @param sessionId The `sessionId` of the [[Session]] you want to start recording + * @param name The name you want to give to the video file. You can access this same value in your clients on recording events (`recordingStarted`, `recordingStopped`) + * + * @returns A Promise that is resolved to the [[Recording]] if it successfully started and rejected with an Error object if not. This Error object has as `message` property with the following values: + * - `404`: no session exists for the passed `sessionId` + * - `400`: the session has no connected participants + * - `409`: the session is not configured for using [[MediaMode.ROUTED]] or it is already being recorded + */ public startRecording(sessionId: string, param2?: string | RecordingProperties): Promise { return new Promise((resolve, reject) => { @@ -116,6 +131,15 @@ export class OpenVidu { }); } + /** + * Stops the recording of a [[Session]] + * + * @param recordingId The `id` property of the [[Recording]] you want to stop + * + * @returns A Promise that is resolved to the [[Recording]] if it successfully stopped and rejected with an Error object if not. This Error object has as `message` property with the following values: + * - `404`: no recording exists for the passed `recordingId` + * - `406`: recording has `starting` status. Wait until `started` status before stopping the recording + */ public stopRecording(recordingId: string): Promise { return new Promise((resolve, reject) => { @@ -156,6 +180,14 @@ export class OpenVidu { }); } + /** + * Gets an existing [[Recording]] + * + * @param recordingId The `id` property of the [[Recording]] you want to retrieve + * + * @returns A Promise that is resolved to the [[Recording]] if it successfully stopped and rejected with an Error object if not. This Error object has as `message` property with the following values: + * - `404`: no recording exists for the passed `recordingId` + */ public getRecording(recordingId: string): Promise { return new Promise((resolve, reject) => { @@ -196,6 +228,11 @@ export class OpenVidu { }); } + /** + * Lists all existing recordings + * + * @returns A Promise that is resolved to an array with all existing recordings + */ public listRecordings(): Promise { return new Promise((resolve, reject) => { @@ -241,6 +278,15 @@ export class OpenVidu { }); } + /** + * Deletes a [[Recording]]. The recording must have status `stopped` or `available` + * + * @param recordingId + * + * @returns A Promise that is resolved if the Recording was successfully deleted and rejected with an Error object if not. This Error object has as `message` property with the following values: + * - `404`: no recording exists for the passed `recordingId` + * - `409`: the recording has `started` status. Stop it before deletion + */ public deleteRecording(recordingId: string): Promise { return new Promise((resolve, reject) => { diff --git a/openvidu-node-client/src/OpenViduRole.ts b/openvidu-node-client/src/OpenViduRole.ts index ba28c93d..405881c5 100644 --- a/openvidu-node-client/src/OpenViduRole.ts +++ b/openvidu-node-client/src/OpenViduRole.ts @@ -16,7 +16,19 @@ */ export enum OpenViduRole { - SUBSCRIBER = 'SUBSCRIBER', // Can subscribe to published streams of other users - PUBLISHER = 'PUBLISHER', // SUBSCRIBER permissions + can subscribe to published streams of other users and publish their own streams - MODERATOR = 'MODERATOR', // SUBSCRIBER + PUBLIHSER permissions + can force unpublish() and disconnect() over a third-party stream or user + + /** + * Can subscribe to published streams of other users + */ + SUBSCRIBER = 'SUBSCRIBER', + + /** + * SUBSCRIBER permissions + can publish their own streams + */ + PUBLISHER = 'PUBLISHER', + + /** + * _(not available yet)_ SUBSCRIBER + PUBLIHSER permissions + can force `unpublish()` and `disconnect()` over a third-party stream or user + */ + MODERATOR = 'MODERATOR' } \ No newline at end of file diff --git a/openvidu-node-client/src/Recording.ts b/openvidu-node-client/src/Recording.ts index 35ec1969..706cf0f5 100644 --- a/openvidu-node-client/src/Recording.ts +++ b/openvidu-node-client/src/Recording.ts @@ -16,20 +16,63 @@ */ import { RecordingLayout } from './RecordingLayout'; -import { RecordingProperties } from './RecordingProperties'; export class Recording { - private id: string; - private sessionId: string; - private createdAt: number; - private size = 0; - private duration = 0; - private url: string; - private hasaudio = true; - private hasvideo = true; - private status: Recording.Status; - private recordingProperties: RecordingProperties; + /** + * Recording unique identifier + */ + id: string; + + /** + * Session associated to the recording + */ + sessionId: string; + + /** + * Time when the recording started in UTC milliseconds + */ + createdAt: number; + + /** + * Size of the recording in bytes (0 until the recording is stopped) + */ + size = 0; + + /** + * Duration of the recording in seconds (0 until the recording is stopped) + */ + duration = 0; + + /** + * URL of the recording. You can access the file from there. It is `null` until recording is stopped or if OpenVidu Server configuration property `openvidu.recording.public-access` is false + */ + url: string; + + /** + * `true` if the recording has an audio track, `false` otherwise (currently fixed to true) + */ + hasAudio = true; + + /** + * `true` if the recording has a video track, `false` otherwise (currently fixed to true) + */ + hasVideo = true; + + /** + * Status of the recording + */ + status: Recording.Status; + + /** + * Name of the Recording. The video file will be named after this property + */ + name: string; + + /** + * The layout used in this Recording + */ + recordingLayout: RecordingLayout; /* tslint:disable:no-string-literal */ constructor(json: JSON) { @@ -39,56 +82,13 @@ export class Recording { this.size = json['size']; this.duration = json['duration']; this.url = json['url']; - this.hasaudio = json['hasAudio']; - this.hasvideo = json['hasVideo']; + this.hasAudio = json['hasAudio']; + this.hasVideo = json['hasVideo']; this.status = json['status']; - this.recordingProperties = { name: json['name'], recordingLayout: json['layout'] }; + this.name = json['name']; + this.recordingLayout = json['recordingLayout']; } /* tslint:enable:no-string-literal */ - - public getStatus(): Recording.Status { - return this.status; - } - - public getId(): string { - return this.id; - } - - public getName(): string { - return this.recordingProperties.name; - } - - public getLayout(): RecordingLayout { - return this.recordingProperties.recordingLayout; - } - - public getSessionId(): string { - return this.sessionId; - } - - public getCreatedAt(): number { - return this.createdAt; - } - - public getSize(): number { - return this.size; - } - - public getDuration(): number { - return this.duration; - } - - public getUrl(): string { - return this.url; - } - - public hasAudio(): boolean { - return this.hasaudio; - } - - public hasVideo(): boolean { - return this.hasvideo; - } } export namespace Recording { diff --git a/openvidu-node-client/src/RecordingLayout.ts b/openvidu-node-client/src/RecordingLayout.ts index 63a4c292..55fa996e 100644 --- a/openvidu-node-client/src/RecordingLayout.ts +++ b/openvidu-node-client/src/RecordingLayout.ts @@ -16,9 +16,29 @@ */ export enum RecordingLayout { - BEST_FIT = 'BEST_FIT', // All the videos are evenly distributed, taking up as much space as possible + + /** + * All the videos are evenly distributed, taking up as much space as possible + */ + BEST_FIT = 'BEST_FIT', + + /** + * _(not available yet)_ + */ PICTURE_IN_PICTURE = 'PICTURE_IN_PICTURE', + + /** + * _(not available yet)_ + */ VERTICAL_PRESENTATION = 'VERTICAL_PRESENTATION', + + /** + * _(not available yet)_ + */ HORIZONTAL_PRESENTATION = 'VERTICAL_PRESENTATION', + + /** + * Use your own custom recording layout. See [Custom recording layouts](http://openvidu.io/docs/advanced-features/recording#custom-recording-layouts) to learn more + */ CUSTOM = 'CUSTOM' } diff --git a/openvidu-node-client/src/RecordingMode.ts b/openvidu-node-client/src/RecordingMode.ts index 840e5361..b4d39bfc 100644 --- a/openvidu-node-client/src/RecordingMode.ts +++ b/openvidu-node-client/src/RecordingMode.ts @@ -16,6 +16,16 @@ */ export enum RecordingMode { - ALWAYS = 'ALWAYS', // The session is recorded automatically (as soon as there are clients publishing streams to the session) - MANUAL = 'MANUAL' // The session is not recorded automatically. To record the session, you can call the OpenVidu.startRecording() method + + /** + * The session is recorded automatically as soon as the first client publishes a stream to the session. It is automatically stopped + * after last user leaves the session (or until you call [[OpenVidu.stopRecording]]). + */ + ALWAYS = 'ALWAYS', + + /** + * The session is not recorded automatically. To record the session, you must call [[OpenVidu.startRecording]] method. To stop the recording, + * you must call [[OpenVidu.stopRecording]]. + */ + MANUAL = 'MANUAL' } diff --git a/openvidu-node-client/src/RecordingProperties.ts b/openvidu-node-client/src/RecordingProperties.ts index 96c39f64..fd680b2f 100644 --- a/openvidu-node-client/src/RecordingProperties.ts +++ b/openvidu-node-client/src/RecordingProperties.ts @@ -18,7 +18,20 @@ import { RecordingLayout } from './RecordingLayout'; export interface RecordingProperties { + + /** + * The name you want to give to the video file. You can access this same value in your clients on recording events (`recordingStarted`, `recordingStopped`) + */ name?: string; + + /** + * The layout to be used in the recording + */ recordingLayout?: RecordingLayout; + + /** + * If [[recordingLayout]] is `CUSTOM`, the relative path to the specific custom layout you want to use. + * See [Custom recording layouts](http://openvidu.io/docs/advanced-features/recording#custom-recording-layouts) to learn more + */ customLayout?: string; } \ No newline at end of file diff --git a/openvidu-node-client/src/Session.ts b/openvidu-node-client/src/Session.ts index 994d19ba..181f75f4 100644 --- a/openvidu-node-client/src/Session.ts +++ b/openvidu-node-client/src/Session.ts @@ -32,21 +32,27 @@ export class Session { private static readonly API_SESSIONS = '/api/sessions'; private static readonly API_TOKENS = '/api/tokens'; - private sessionId = ''; - private properties: SessionProperties; + sessionId: string; + properties: SessionProperties; constructor(private hostname: string, private port: number, private basicAuth: string, properties?: SessionProperties) { - if (properties === null) { + if (!properties) { this.properties = {}; } else { this.properties = properties; } } + /** + * Gets the unique identifier of the Session. This translates into a new request to OpenVidu Server if this Session has no `sessionId` yet + * or simply returns the existing value if it has already been retrieved + * + * @returns A Promise that is resolved to the _sessionId_ if success and rejected with an Error object if not (due to a `400 (Bad Request)` error in OpenVidu Server) + */ public getSessionId(): Promise { return new Promise((resolve, reject) => { - if (this.sessionId) { + if (!!this.sessionId) { resolve(this.sessionId); } @@ -96,6 +102,11 @@ export class Session { }); } + /** + * Gets a new token associated to Session object. This translates into a new request to OpenVidu Server + * + * @returns A Promise that is resolved to the _token_ if success and rejected with an Error object if not (due to a `400 (Bad Request)` error in OpenVidu Server) + */ public generateToken(tokenOptions?: TokenOptions): Promise { return new Promise((resolve, reject) => { @@ -143,8 +154,4 @@ export class Session { }); } - public getProperties(): SessionProperties { - return this.properties; - } - } \ No newline at end of file diff --git a/openvidu-node-client/src/SessionProperties.ts b/openvidu-node-client/src/SessionProperties.ts index fc905694..12899a41 100644 --- a/openvidu-node-client/src/SessionProperties.ts +++ b/openvidu-node-client/src/SessionProperties.ts @@ -20,8 +20,19 @@ import { RecordingLayout } from './RecordingLayout'; import { RecordingMode } from './RecordingMode'; export interface SessionProperties { + mediaMode?: MediaMode; recordingMode?: RecordingMode; + + /** + * Default value used to initialize property [[RecordingProperties.recordingLayout]] of every recording of this session. + * You can easily override this value later by setting [[RecordingProperties.recordingLayout]] to any other value + */ defaultRecordingLayout?: RecordingLayout; + + /** + * Default value used to initialize property [[RecordingProperties.customLayout]] of every recording of this session. + * You can easily override this value later by setting [[RecordingProperties.customLayout]] to any other value + */ defaultCustomLayout?: string; } diff --git a/openvidu-node-client/src/TokenOptions.ts b/openvidu-node-client/src/TokenOptions.ts index 72ea5cff..7578ca98 100644 --- a/openvidu-node-client/src/TokenOptions.ts +++ b/openvidu-node-client/src/TokenOptions.ts @@ -18,6 +18,14 @@ import { OpenViduRole } from './OpenViduRole'; export interface TokenOptions { + + /** + * Secure (server-side) data associated to this token. Every client will receive this data in property `Connection.data`. Object `Connection` can be retrieved by subscribing to event `connectionCreated` of Session object. + * - If you have provided no data in your clients when calling method `Session.connect(TOKEN, DATA)` (`DATA` not defined), then `Connection.data` will only have this [[TokenOptions.data]] property. + * - If you have provided some data when calling `Session.connect(TOKEN, DATA)` (`DATA` defined), then `Connection.data` will have the following structure: `"CLIENT_DATA%/%SERVER_DATA"`, being `CLIENT_DATA` the second + * parameter passed in OpenVidu Browser in method `Session.connect` and `SERVER_DATA` this [[TokenOptions.data]] property. + */ data: string; + role: OpenViduRole; } \ No newline at end of file