Explorar el Código

Adds jitsi meet library interface files.

tags/v0.0.2
hristoterezov hace 10 años
padre
commit
d159c81135
Se han modificado 6 ficheros con 389 adiciones y 0 borrados
  1. 149
    0
      Conference.js
  2. 23
    0
      ConferenceErrors.js
  3. 68
    0
      ConferenceEvents.js
  4. 52
    0
      Connection.js
  5. 16
    0
      JitsiMeetJS.js
  6. 81
    0
      Stream.js

+ 149
- 0
Conference.js Ver fichero

@@ -0,0 +1,149 @@
1
+/**
2
+ * Creates a Conference object with the given name and properties.
3
+ * Note: this constructor is not a part of the public API (objects should be
4
+ * created using Connection.createConference).
5
+ * @param name name of the conference.
6
+ * @param options Object with properties / settings related to the conference that will be created.
7
+ * @param connection The Connection object for this Conference.
8
+ * @constructor
9
+ */
10
+
11
+function Conference(name, options, connection) {
12
+    
13
+}
14
+
15
+/**
16
+ * Joins the conference.
17
+ */
18
+Conference.prototype.join = function () {
19
+
20
+}
21
+
22
+/**
23
+ * Leaves the conference.
24
+ */
25
+Conference.prototype.leave = function () {
26
+
27
+}
28
+
29
+/**
30
+ * Creates the media streams and returns them via the callback.
31
+ * @param options Object with properties / settings defining which streams(Stream.AUDIO, Stream.VIDEO, Stream.DESKTOP)
32
+ * should be created or some additional configurations about resolution for example.
33
+ * @param successCallback callback that will receive the streams.
34
+ * @param errorCallback callback that will be called if accessing the media streams fail.
35
+ * @return an array of all created MediaStream-s
36
+ */
37
+Conference.prototype.createMediaStreams = function (options, successCallback, errorCallback) {
38
+
39
+}
40
+
41
+/**
42
+ * Attaches a handler for events(For example - "participant joined".) in the conference. All possible event are defined
43
+ * in ConferenceEvents.
44
+ * @param eventId the event ID.
45
+ * @param handler handler for the event.
46
+ */
47
+Conference.prototype.addEventListener = function (eventId, handler) {
48
+
49
+}
50
+
51
+/**
52
+ * Removes event listener
53
+ * @param eventId the event ID.
54
+ */
55
+Conference.prototype.removeEventListener = function (eventId) {
56
+
57
+}
58
+
59
+/**
60
+ * Receives notifications from another participants for commands / custom events(send by sendPresenceCommand method).
61
+ * @param command {String} the name of the command
62
+ * @param handler {Function} handler for the command
63
+ */
64
+Conference.prototype.addPresenceCommandListener = function (command, handler) {
65
+
66
+}
67
+
68
+
69
+/**
70
+ * Removes command  listener
71
+ * @param command {String}  the name of the command
72
+ */
73
+Conference.prototype.removePresenceCommandListener = function (command) {
74
+
75
+}
76
+
77
+/**
78
+ * Sends local streams to the server side.
79
+ * @param stream the stream object.
80
+ * @param successCallback callback that will be called when the stream is sending is successfull.
81
+ * @param errorCallback callback that will be called if something go wrong.
82
+ */
83
+Conference.prototype.sendStream = function (stream, successCallback, errorCallback) {
84
+
85
+}
86
+
87
+/**
88
+ * Sends text message to the other participants in the conference
89
+ * @param message the text message.
90
+ */
91
+Conference.prototype.sendTextMessage = function (message) {
92
+
93
+}
94
+
95
+/**
96
+ * Send presence command.
97
+ * @param name the name of the command.
98
+ * @param values Object with keys and values that will be send.
99
+ * @param persistent if false the command will be sent only one time
100
+ * otherwise it will be sent with every system message sent to the other participants.
101
+ * @param successCallback will be called when the command is successfully send.
102
+ * @param errorCallback will be called when the command is not sent successfully.
103
+ */
104
+Conference.prototype.sendPresenceCommand = function (name, values, persistent, successCallback, errorCallback) {
105
+
106
+}
107
+
108
+/**
109
+ * Sets the display name for this conference.
110
+ * @param name the display name to set
111
+ */
112
+Conference.prototype.setDisplayName = function(name) {
113
+
114
+}
115
+
116
+/**
117
+ * Start desktop sharing. This will replace the video stream with the desktop sharing stream.
118
+ * @return Stream stream of type DESKTOP
119
+ */
120
+Conference.prototype.startDesktopSharing = function() {
121
+
122
+}
123
+
124
+/**
125
+ * Stop desktop sharing. This will replace the desktop stream with the video stream.
126
+ * @return Stream stream of type VIDEO
127
+ */
128
+Conference.prototype.endDesktopSharing = function() {
129
+
130
+}
131
+
132
+/**
133
+ * Elects the participant with the given id to be the selected participant or the speaker.
134
+ * @param id the identifier of the participant
135
+ */
136
+Conference.prototype.selectParticipant = function(participantId) {
137
+
138
+}
139
+
140
+/**
141
+ * Returns the list of participants for this conference.
142
+ * @return Object a list of participant identifiers containing all conference participants.
143
+ */
144
+Conference.prototype.getParticipants = function() {
145
+
146
+}
147
+
148
+
149
+module.exports = Conference;

+ 23
- 0
ConferenceErrors.js Ver fichero

@@ -0,0 +1,23 @@
1
+/**
2
+ * Enumeration with the erros for the conference.
3
+ * @type {{string: string}}
4
+ */
5
+var ConferenceErrors = {
6
+    /**
7
+     * Indicates that a password is required in order to join the conference.
8
+     */
9
+    PASSWORD_REQUIRED: "conference.passwordRequired",
10
+    /**
11
+     * Indicates that a connection error occurred when trying to join a conference.
12
+     */
13
+    CONNECTION_ERROR: "conference.connectionError",
14
+    /**
15
+     * Indicates that the video bridge is down.
16
+     */
17
+    BRIDGE_DOWN: "conference.bridgeDown"
18
+    /**
19
+     * Many more errors TBD here.
20
+     */
21
+};
22
+
23
+module.exports = ConferenceErrors;

+ 68
- 0
ConferenceEvents.js Ver fichero

@@ -0,0 +1,68 @@
1
+/**
2
+ * Enumeration with the events for the conference.
3
+ * @type {{string: string}}
4
+ */
5
+var ConferenceEvents = {
6
+    /**
7
+     * New media stream was added to the conference.
8
+     */
9
+    STREAM_ADDED: "conference.streamAdded",
10
+    /**
11
+     * The media stream was removed to the conference.
12
+     */
13
+    STREAM_REMOVED: "conference.streamRemoved",
14
+    /**
15
+     * The active speaker was changed.
16
+     */
17
+    ACTIVE_SPEAKER_CHANGED: "conference.activeSpeaker",
18
+    /**
19
+     * A new user joinned the conference.
20
+     */
21
+    USER_JOINED: "conference.userJoined",
22
+    /**
23
+     * A user has left the conference.
24
+     */
25
+    USER_LEFT: "conference.userLeft",
26
+    /**
27
+     * New text message was received.
28
+     */
29
+    MESSAGE_RECEIVED: "conference.messageReceived",
30
+    /**
31
+     * A user has changed it display name
32
+     */
33
+    DISPLAY_NAME_CHANGED: "conference.displayNameChanged",
34
+    /**
35
+     * A participant avatar has changed.
36
+     */
37
+    AVATAR_CHANGED: "conference.avatarChanged",
38
+    /**
39
+     * New connection statistics are received.
40
+     */
41
+    CONNECTION_STATS_RECEIVED: "conference.connectionStatsReceived",
42
+    /**
43
+     * The Last N set is changed.
44
+     */
45
+    LAST_N_CHANGED: "conference.lastNChanged",
46
+    /**
47
+     * Stream was muted.
48
+     */
49
+    STREAM_MUTED: "conference.streamMuted",
50
+    /**
51
+     * Stream was unmuted.
52
+     */
53
+    STREAM_UNMUTED: "conference.streamUnmuted",
54
+    /**
55
+     * Audio levels of a stream was changed.
56
+     */
57
+    STREAM_AUDIO_LEVEL_CHANGED: "conference.audioLevelsChanged",
58
+    /**
59
+     * Indicates that the connection to the conference has been interrupted for some reason.
60
+     */
61
+    CONNECTION_INTERRUPTED: "conference.connecionInterrupted",
62
+    /**
63
+     * Indicates that the connection to the conference has been restored.
64
+     */
65
+    CONNECTION_RESTORED: "conference.connecionRestored"
66
+};
67
+
68
+module.exports = ConferenceEvents;

+ 52
- 0
Connection.js Ver fichero

@@ -0,0 +1,52 @@
1
+var Conference = require("./Conference");
2
+
3
+/**
4
+ * Creates new connection object for the Jitsi Meet server side video conferencing service. Provides access to the
5
+ * Conference interface.
6
+ * @param appID identification for the provider of Jitsi Meet video conferencing services.
7
+ * @param token secret generated by the provider of Jitsi Meet video conferencing services.
8
+ * The token will be send to the provider from the Jitsi Meet server deployment for authorization of the current client.
9
+ * @param options Object with properties / settings related to connection with the server.
10
+ * @constructor
11
+ */
12
+function Connection(appID, token, options) {
13
+
14
+}
15
+
16
+/**
17
+ * Connect the client with the server.
18
+ * @param successCallback this callback will be called when the connection is successfull
19
+ * @param errorCallback this callback will be called when the connection fail.
20
+ */
21
+Connection.prototype.connect = function (successCallback, errorCallback) {
22
+
23
+}
24
+
25
+/**
26
+ * Disconnect the client from the server.
27
+ * @param successCallback this callback will be called when we have successfully disconnected
28
+ * @param errorCallback this callback will be called when the disconnect didn't succeed
29
+ */
30
+Connection.prototype.disconnect = function (successCallback, errorCallback) {
31
+
32
+}
33
+
34
+/**
35
+ * This method allows renewal of the tokens if they are expiring.
36
+ * @param token the new token.
37
+ */
38
+Connection.prototype.setToken = function (token) {
39
+
40
+}
41
+
42
+/**
43
+ * Creates and joins new conference.
44
+ * @param name the name of the conference; if null - a generated name will be provided from the api
45
+ * @param options Object with properties / settings related to the conference that will be created.
46
+ * @returns {Conference} returns the new conference object.
47
+ */
48
+Connection.prototype.initConference = function (name, options) {
49
+    return new Conference(name, options, this);
50
+}
51
+
52
+module.exports = Connection;

+ 16
- 0
JitsiMeetJS.js Ver fichero

@@ -0,0 +1,16 @@
1
+var Connection = require("./Connection");
2
+var ConferenceEvents = require("./ConferenceEvents");
3
+
4
+/**
5
+ * Namespace for the interface of Jitsi Meet Library.
6
+ */
7
+var LibJitsiMeet = {
8
+
9
+    Connection: Connection,
10
+    events: {
11
+        conference: ConferenceEvents
12
+    }
13
+
14
+}
15
+
16
+module.exports = LibJitsiMeet;

+ 81
- 0
Stream.js Ver fichero

@@ -0,0 +1,81 @@
1
+/**
2
+ * Represents media stream(audio, video, desktop)
3
+ * @constructor
4
+ */
5
+function Stream()
6
+{
7
+
8
+}
9
+
10
+/**
11
+ * Stream video type.
12
+ * @type {string}
13
+ */
14
+Stream.VIDEO = "video";
15
+
16
+/**
17
+ * Stream audio type.
18
+ * @type {string}
19
+ */
20
+Stream.AUDIO = "audio";
21
+
22
+/**
23
+ * Stream desktop sharing type.
24
+ * @type {string}
25
+ */
26
+Stream.DESKTOP_SHARING = "desktopsharing";
27
+
28
+/**
29
+ * The media stream type.
30
+ */
31
+Stream.prototype.streamType;
32
+
33
+/**
34
+ * The corresponding participant identifier.
35
+ */
36
+Stream.prototype.participantId;
37
+
38
+/**
39
+ * The media stream from the browser.
40
+ */
41
+Stream.prototype.originalStream;
42
+
43
+/**
44
+ * Mutes the stream.
45
+ */
46
+Stream.prototype.mute = function () {
47
+
48
+}
49
+
50
+/**
51
+ * Unmutes the stream.
52
+ */
53
+Stream.prototype.unmute = function () {
54
+
55
+}
56
+
57
+/**
58
+ * Attaches the stream to HTML container.
59
+ * @param container the HTML container
60
+ */
61
+Stream.prototype.attachStream = function (container) {
62
+
63
+}
64
+
65
+/**
66
+ * Removes the stream from the passed HTML container.
67
+ * @param container the HTML container
68
+ */
69
+Stream.prototype.remove = function (container) {
70
+
71
+}
72
+
73
+/**
74
+ * Stops sending the stream. And removes it from the HTML.
75
+ * NOTE: Works for the local stream only.
76
+ */
77
+Stream.prototype.stop = function () {
78
+
79
+}
80
+
81
+module.exports = Stream;

Loading…
Cancelar
Guardar