Skip to content

Commit

Permalink
Fix issues with audio only streams. (lynckia#986)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcague authored Jul 27, 2017
1 parent e6e8e55 commit 40278fc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 3 additions & 0 deletions erizo_controller/erizoClient/src/Events.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ const EventDispatcher = () => {

// It removes an available event listener.
that.removeEventListener = (eventType, listener) => {
if (!dispatcher.eventListeners[eventType]) {
return;
}
const index = dispatcher.eventListeners[eventType].indexOf(listener);
if (index !== -1) {
dispatcher.eventListeners[eventType].splice(index, 1);
Expand Down
8 changes: 5 additions & 3 deletions erizo_controller/erizoClient/src/Room.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ const Room = (altIo, altConnection, specInput) => {
browser: stream.pc.browser }, undefined, () => {});
},
nop2p: true,
audio: stream.hasAudio(),
video: stream.hasVideo(),
audio: options.audio && stream.hasAudio(),
video: options.video && stream.hasVideo(),
maxAudioBW: options.maxAudioBW,
maxVideoBW: options.maxVideoBW,
limitMaxAudioBW: spec.maxAudioBW,
Expand Down Expand Up @@ -437,7 +437,9 @@ const Room = (altIo, altConnection, specInput) => {
if (options.maxVideoBW > spec.maxVideoBW) {
options.maxVideoBW = spec.maxVideoBW;
}
Logger.info('Checking subscribe options for', stream.getID());
options.audio = (options.audio === undefined) ? true : options.audio;
options.video = (options.video === undefined) ? true : options.video;
options.data = (options.data === undefined) ? true : options.data;
stream.checkOptions(options);
const constraint = { streamId: stream.getID(),
audio: options.audio && stream.hasAudio(),
Expand Down
4 changes: 2 additions & 2 deletions erizo_controller/erizoClient/src/webrtc-stacks/BaseStack.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ const BaseStack = (specInput) => {
specBase.remoteDescriptionSet = false;

that.mediaConstraints = {
offerToReceiveVideo: (specBase.video !== undefined),
offerToReceiveAudio: (specBase.audio !== undefined),
offerToReceiveVideo: (specBase.video !== undefined && specBase.video !== false),
offerToReceiveAudio: (specBase.audio !== undefined && specBase.audio !== false),
};

that.peerConnection = new RTCPeerConnection(that.pcConfig, that.con);
Expand Down

0 comments on commit 40278fc

Please sign in to comment.