diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2020-08-27 18:22:13 +0300 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2020-08-27 18:30:24 +0300 |
commit | ff416fd370453eceeead573945b2f7975033eeb4 (patch) | |
tree | 3ea09f1880929fe89f3edbdf035cf68727216183 /src | |
parent | 65f83b992ad18ff80ffea30d22082796778e394b (diff) |
Get rid of "hark" data channel
The Web UI sends "speaking" and "stoppedSpeaking" messages through the
"status" and "hark" data channels, but the messages are simply ignored
when received in the "hark" data channel. The Android and iOS apps do
not even use the "hark" data channel, neither for sending nor for
listening, so it can be fully removed.
Moreover, with latest Janus versions the peers receive all data channel
messages in the "JanusDataChannel" data channel, no matter on which data
channel they were originally sent. As the "speaking" and
"stoppedSpeaking" messages are sent through the "status" data channel
sending them too through the "hark" data channel caused the messages to
be handled twice.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/utils/webrtc/simplewebrtc/webrtc.js | 28 | ||||
-rw-r--r-- | src/utils/webrtc/webrtc.js | 2 |
2 files changed, 0 insertions, 30 deletions
diff --git a/src/utils/webrtc/simplewebrtc/webrtc.js b/src/utils/webrtc/simplewebrtc/webrtc.js index 3ba67e7b6..fc44ab2d1 100644 --- a/src/utils/webrtc/simplewebrtc/webrtc.js +++ b/src/utils/webrtc/simplewebrtc/webrtc.js @@ -58,34 +58,6 @@ function WebRTC(opts) { // call localMedia constructor localMedia.call(this, this.config) - this.on('speaking', function() { - if (!self.hardMuted) { - // FIXME: should use sendDirectlyToAll, but currently has different semantics wrt payload - self.peers.forEach(function(peer) { - if (peer.enableDataChannels) { - const dc = peer.getDataChannel('hark') - if (dc.readyState !== 'open') { - return - } - dc.send(JSON.stringify({ type: 'speaking' })) - } - }) - } - }) - this.on('stoppedSpeaking', function() { - if (!self.hardMuted) { - // FIXME: should use sendDirectlyToAll, but currently has different semantics wrt payload - self.peers.forEach(function(peer) { - if (peer.enableDataChannels) { - const dc = peer.getDataChannel('hark') - if (dc.readyState !== 'open') { - return - } - dc.send(JSON.stringify({ type: 'stoppedSpeaking' })) - } - }) - } - }) this.on('unshareScreen', function(message) { // End peers we were receiving the screensharing stream from. const peers = self.getPeers(message.id, 'screen') diff --git a/src/utils/webrtc/webrtc.js b/src/utils/webrtc/webrtc.js index c3535dddb..4faf7c6e5 100644 --- a/src/utils/webrtc/webrtc.js +++ b/src/utils/webrtc/webrtc.js @@ -895,8 +895,6 @@ export default function initWebRTC(signaling, _callParticipantCollection, _local } else { console.debug('Unknown message type %s from %s datachannel', data.type, label, data) } - } else if (label === 'hark') { - // Ignore messages from hark datachannel } else { console.debug('Unknown message from %s datachannel', label, data) } |