Adds an option to enable adaptive-last-n.

This commit is contained in:
Boris Grozev 2014-10-01 14:24:37 +03:00
parent ac5d57d02d
commit 5bec891d41
2 changed files with 17 additions and 4 deletions

View File

@ -20,6 +20,7 @@ var config = {
enableRtpStats: true, // Enables RTP stats processing
openSctp: true, // Toggle to enable/disable SCTP channels
channelLastN: -1, // The default value of the channel attribute last-n.
adaptiveLastN: false,
useRtcpMux: true,
useBundle: true,
enableRecording: false,

View File

@ -292,8 +292,14 @@ ColibriFocus.prototype._makeConference = function (errorCallback) {
else
{
elemName = 'channel';
if (('video' === name) && (self.channelLastN >= 0))
elemAttrs['last-n'] = self.channelLastN;
if ('video' === name) {
if (self.channelLastN >= 0) {
elemAttrs['last-n'] = self.channelLastN;
}
if (config.adaptiveLastN) {
elemAttrs['adaptive-last-n'] = 'true';
}
}
}
elem.c('content', { name: name });
@ -834,8 +840,14 @@ ColibriFocus.prototype.addNewParticipant = function (peer) {
else
{
elemName = 'channel';
if (('video' === name) && (self.channelLastN >= 0))
elemAttrs['last-n'] = self.channelLastN;
if ('video' === name) {
if (self.channelLastN >= 0) {
elemAttrs['last-n'] = self.channelLastN;
}
if (config.adaptiveLastN) {
elemAttrs['adaptive-last-n'] = 'true';
}
}
}
elem.c('content', { name: name });