Skip to content

Commit

Permalink
Fix SDP negotiation when a stream is audio only (lynckia#1307)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcague authored Oct 2, 2018
1 parent b37a5c1 commit 03b381f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions erizo/src/erizo/WebRtcConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ std::shared_ptr<SdpInfo> WebRtcConnection::getLocalSdpInfo() {
bool receiving_audio = remote_sdp_->audio_ssrc_map.size() > 0;
bool receiving_video = remote_sdp_->video_ssrc_map.size() > 0;

audio_enabled_ = sending_audio || receiving_audio;
video_enabled_ = sending_video || receiving_video;

if (!sending_audio && receiving_audio) {
local_sdp_->audioDirection = erizo::RECVONLY;
} else if (sending_audio && !receiving_audio) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ const ChromeStableStack = (specInput) => {
const spec = specInput;
const that = BaseStack(specInput);
const defaultSimulcastSpatialLayers = 2;
that.mediaConstraints = {
offerToReceiveVideo: true,
offerToReceiveAudio: true,
};

that.enableSimulcast = (sdpInput) => {
let result;
Expand Down
3 changes: 2 additions & 1 deletion extras/basic_example/public/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,13 @@ window.onload = function () {
var roomName = getParameterByName('room') || 'basicExampleRoom';
var singlePC = getParameterByName('singlePC') || false;
var roomType = getParameterByName('type') || 'erizo';
var audioOnly = getParameterByName('onlyAudio') || false;
var mediaConfiguration = getParameterByName('mediaConfiguration') || 'default';
var onlySubscribe = getParameterByName('onlySubscribe');
var onlyPublish = getParameterByName('onlyPublish');
console.log('Selected Room', roomName, 'of type', roomType);
var config = {audio: true,
video: true,
video: !audioOnly,
data: true,
screen: screen,
videoSize: [640, 480, 640, 480],
Expand Down

0 comments on commit 03b381f

Please sign in to comment.