Skip to content

Commit

Permalink
Moved to "older-server.js"
Browse files Browse the repository at this point in the history
  • Loading branch information
muaz-khan committed Aug 26, 2019
1 parent cfd8c4b commit ac87dc9
Show file tree
Hide file tree
Showing 4 changed files with 310 additions and 747 deletions.
74 changes: 74 additions & 0 deletions demos/video-conferencing.html
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,80 @@ <h1>
OfferToReceiveVideo: true
};

// STAR_FIX_VIDEO_AUTO_PAUSE_ISSUES
// via: https://github.com/muaz-khan/RTCMultiConnection/issues/778#issuecomment-524853468
var bitrates = 512;
var resolutions = 'Ultra-HD';
var videoConstraints = {};

if (resolutions == 'HD') {
videoConstraints = {
width: {
ideal: 1280
},
height: {
ideal: 720
},
frameRate: 30
};
}

if (resolutions == 'Ultra-HD') {
videoConstraints = {
width: {
ideal: 1920
},
height: {
ideal: 1080
},
frameRate: 30
};
}

connection.mediaConstraints = {
video: videoConstraints,
audio: true
};

var CodecsHandler = connection.CodecsHandler;

connection.processSdp = function(sdp) {
var codecs = 'vp8';

if (codecs.length) {
sdp = CodecsHandler.preferCodec(sdp, codecs.toLowerCase());
}

if (resolutions == 'HD') {
sdp = CodecsHandler.setApplicationSpecificBandwidth(sdp, {
audio: 128,
video: bitrates,
screen: bitrates
});

sdp = CodecsHandler.setVideoBitrates(sdp, {
min: bitrates * 8 * 1024,
max: bitrates * 8 * 1024,
});
}

if (resolutions == 'Ultra-HD') {
sdp = CodecsHandler.setApplicationSpecificBandwidth(sdp, {
audio: 128,
video: bitrates,
screen: bitrates
});

sdp = CodecsHandler.setVideoBitrates(sdp, {
min: bitrates * 8 * 1024,
max: bitrates * 8 * 1024,
});
}

return sdp;
};
// END_FIX_VIDEO_AUTO_PAUSE_ISSUES

// https://www.rtcmulticonnection.org/docs/iceServers/
// use your own TURN-server here!
connection.iceServers = [{
Expand Down
Loading

0 comments on commit ac87dc9

Please sign in to comment.