|
|
@@ -51,7 +51,7 @@ function DataChannels(peerConnection, emitter) {
|
|
51
|
51
|
DataChannels.prototype.onDataChannel = function (event) {
|
|
52
|
52
|
var dataChannel = event.channel;
|
|
53
|
53
|
var self = this;
|
|
54
|
|
- var lastSelectedEndpoint = null;
|
|
|
54
|
+ var selectedEndpoint = null;
|
|
55
|
55
|
|
|
56
|
56
|
dataChannel.onopen = function () {
|
|
57
|
57
|
logger.info("Data channel opened by the Videobridge!", dataChannel);
|
|
|
@@ -68,7 +68,8 @@ DataChannels.prototype.onDataChannel = function (event) {
|
|
68
|
68
|
// selections so that it can do adaptive simulcast,
|
|
69
|
69
|
// we want the notification to trigger even if userJid is undefined,
|
|
70
|
70
|
// or null.
|
|
71
|
|
- self.handleSelectedEndpointEvent(self.lastSelectedEndpoint);
|
|
|
71
|
+ // XXX why do we not do the same for pinned endpoints?
|
|
|
72
|
+ self.sendSelectedEndpointMessage(self.selectedEndpoint);
|
|
72
|
73
|
};
|
|
73
|
74
|
|
|
74
|
75
|
dataChannel.onerror = function (error) {
|
|
|
@@ -173,13 +174,19 @@ DataChannels.prototype.closeAllChannels = function () {
|
|
173
|
174
|
});
|
|
174
|
175
|
};
|
|
175
|
176
|
|
|
176
|
|
-DataChannels.prototype.handleSelectedEndpointEvent = function (userResource) {
|
|
177
|
|
- this.lastSelectedEndpoint = userResource;
|
|
178
|
|
- this._onXXXEndpointChanged("selected", userResource);
|
|
|
177
|
+/**
|
|
|
178
|
+ * Sends a "selected endpoint changed" message via the data channel.
|
|
|
179
|
+ */
|
|
|
180
|
+DataChannels.prototype.sendSelectedEndpointMessage = function (endpointId) {
|
|
|
181
|
+ this.selectedEndpoint = endpointId;
|
|
|
182
|
+ this._onXXXEndpointChanged("selected", endpointId);
|
|
179
|
183
|
};
|
|
180
|
184
|
|
|
181
|
|
-DataChannels.prototype.handlePinnedEndpointEvent = function (userResource) {
|
|
182
|
|
- this._onXXXEndpointChanged("pinnned", userResource);
|
|
|
185
|
+/**
|
|
|
186
|
+ * Sends a "pinned endpoint changed" message via the data channel.
|
|
|
187
|
+ */
|
|
|
188
|
+DataChannels.prototype.sendPinnedEndpointMessage = function (endpointId) {
|
|
|
189
|
+ this._onXXXEndpointChanged("pinnned", endpointId);
|
|
183
|
190
|
};
|
|
184
|
191
|
|
|
185
|
192
|
/**
|