Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace old APIs with explicit addTransceivers #50

Open
wants to merge 1 commit into
base: develop-pre-2.3.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions examples/master.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,9 @@ async function startMaster(localView, remoteView, formValues, onStatsReport, onR

// Create an SDP answer to send back to the client
console.log('[MASTER] Creating SDP answer for client: ' + remoteClientId);
await peerConnection.setLocalDescription(
await peerConnection.createAnswer({
offerToReceiveAudio: true,
offerToReceiveVideo: true,
}),
);
peerConnection.addTransceiver('video', {'direction': formValues.sendVideo ? 'sendrecv' : 'recvonly'});
peerConnection.addTransceiver('audio', {'direction': formValues.sendAudio ? 'sendrecv' : 'recvonly'});
await peerConnection.setLocalDescription(await peerConnection.createAnswer());

// When trickle ICE is enabled, send the answer now and then send ICE candidates as they are generated. Otherwise wait on the ICE candidates.
if (formValues.useTrickleICE) {
Expand Down
9 changes: 3 additions & 6 deletions examples/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,9 @@ async function startViewer(localView, remoteView, formValues, onStatsReport, onR

// Create an SDP offer to send to the master
console.log('[VIEWER] Creating SDP offer');
await viewer.peerConnection.setLocalDescription(
await viewer.peerConnection.createOffer({
offerToReceiveAudio: true,
offerToReceiveVideo: true,
}),
);
viewer.peerConnection.addTransceiver('video', {'direction': formValues.sendVideo ? 'sendrecv' : 'recvonly'});
viewer.peerConnection.addTransceiver('audio', {'direction': formValues.sendAudio ? 'sendrecv' : 'recvonly'});
await viewer.peerConnection.setLocalDescription(await viewer.peerConnection.createOffer());

// When trickle ICE is enabled, send the offer now and then send ICE candidates as they are generated. Otherwise wait on the ICE candidates.
if (formValues.useTrickleICE) {
Expand Down