Skip to content

Commit 6f2e4de

Browse files
authored
Merge branch 'gh-pages' into bye-travis
2 parents d2996bf + 60f3b4a commit 6f2e4de

File tree

1 file changed

+2
-13
lines changed
  • src/content/peerconnection/change-codecs/js

1 file changed

+2
-13
lines changed

src/content/peerconnection/change-codecs/js/main.js

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ const supportsSetCodecPreferences = window.RTCRtpTransceiver &&
4747
let localStream;
4848
let pc1;
4949
let pc2;
50-
const offerOptions = {
51-
offerToReceiveAudio: 1,
52-
offerToReceiveVideo: 1
53-
};
5450

5551
function getName(pc) {
5652
return (pc === pc1) ? 'pc1' : 'pc2';
@@ -64,7 +60,7 @@ async function start() {
6460
console.log('Requesting local stream');
6561
startButton.disabled = true;
6662
try {
67-
const stream = await navigator.mediaDevices.getUserMedia({audio: true, video: true});
63+
const stream = await navigator.mediaDevices.getUserMedia({video: true});
6864
console.log('Received local stream');
6965
localVideo.srcObject = stream;
7066
localStream = stream;
@@ -93,13 +89,9 @@ async function call() {
9389
console.log('Starting call');
9490
startTime = window.performance.now();
9591
const videoTracks = localStream.getVideoTracks();
96-
const audioTracks = localStream.getAudioTracks();
9792
if (videoTracks.length > 0) {
9893
console.log(`Using video device: ${videoTracks[0].label}`);
9994
}
100-
if (audioTracks.length > 0) {
101-
console.log(`Using audio device: ${audioTracks[0].label}`);
102-
}
10395
const configuration = {};
10496
console.log('RTCPeerConnection configuration:', configuration);
10597
pc1 = new RTCPeerConnection(configuration);
@@ -116,7 +108,7 @@ async function call() {
116108

117109
try {
118110
console.log('pc1 createOffer start');
119-
const offer = await pc1.createOffer(offerOptions);
111+
const offer = await pc1.createOffer();
120112
await onCreateOfferSuccess(offer);
121113
} catch (e) {
122114
onCreateSessionDescriptionError(e);
@@ -146,9 +138,6 @@ async function onCreateOfferSuccess(desc) {
146138
}
147139

148140
console.log('pc2 createAnswer start');
149-
// Since the 'remote' side has no media stream we need
150-
// to pass in the right constraints in order for it to
151-
// accept the incoming offer of audio and video.
152141
try {
153142
const answer = await pc2.createAnswer();
154143
await onCreateAnswerSuccess(answer);

0 commit comments

Comments
 (0)