Skip to content

Commit

Permalink
remove debug comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasIO committed Jan 7, 2025
1 parent 8dbd5a2 commit 5512f57
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 11 deletions.
7 changes: 1 addition & 6 deletions examples/demo/demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const state = {
isFrontFacing: false,
encoder: new TextEncoder(),
decoder: new TextDecoder(),
defaultDevices: new Map<MediaDeviceKind, string>(),
defaultDevices: new Map<MediaDeviceKind, string>([['audioinput', 'default']]),
bitrateInterval: undefined as any,
e2eeKeyProvider: new ExternalE2EEKeyProvider(),
};
Expand Down Expand Up @@ -440,7 +440,6 @@ const appActions = {
}

if (currentRoom) {
console.log('handling device select due to change in select element');
await currentRoom.switchActiveDevice(kind, deviceId);
}
},
Expand Down Expand Up @@ -500,7 +499,6 @@ function handleChatMessage(msg: ChatMessage, participant?: LocalParticipant | Re

function participantConnected(participant: Participant) {
appendLog('participant', participant.identity, 'connected', participant.metadata);
console.log('tracks', participant.trackPublications);
participant
.on(ParticipantEvent.TrackMuted, (pub: TrackPublication) => {
appendLog('track was muted', pub.trackSid, participant.identity);
Expand Down Expand Up @@ -871,7 +869,6 @@ const elementMapping: { [k: string]: MediaDeviceKind } = {
} as const;

async function handleDevicesChanged() {
console.log('devices changed');
Promise.all(
Object.keys(elementMapping).map(async (id) => {
const kind = elementMapping[id];
Expand All @@ -880,14 +877,12 @@ async function handleDevicesChanged() {
}
const devices = await Room.getLocalDevices(kind);
const element = <HTMLSelectElement>$(id);
console.log('default device', kind, state.defaultDevices.get(kind));
populateSelect(element, devices, state.defaultDevices.get(kind));
}),
);
}

async function handleActiveDeviceChanged(kind: MediaDeviceKind, deviceId: string) {
console.trace('active device changed to', kind, deviceId);
state.defaultDevices.set(kind, deviceId);
const devices = await Room.getLocalDevices(kind);
const element = <HTMLSelectElement>$(
Expand Down
1 change: 0 additions & 1 deletion src/room/Room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1658,7 +1658,6 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
// check for available devices, but don't request permissions in order to avoid prompts for kinds that haven't been used before
const availableDevices = await DeviceManager.getInstance().getDevices(undefined, false);

console.log({ previousDevices, availableDevices });
const browser = getBrowser();
if (browser?.name === 'Chrome' && browser.os !== 'iOS') {
for (let availableDevice of availableDevices) {
Expand Down
3 changes: 0 additions & 3 deletions src/room/participant/LocalParticipant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,6 @@ export default class LocalParticipant extends Participant {

break;
case Track.Source.Microphone:
console.log('acquiring mic with', options ?? true);
localTracks = await this.createTracks({
audio: (options as AudioCaptureOptions | undefined) ?? true,
});
Expand Down Expand Up @@ -589,8 +588,6 @@ export default class LocalParticipant extends Participant {
const constraints = constraintsForOptions(mergedOptions);
let stream: MediaStream | undefined;
try {
console.log('acquiring media devices with', constraints);

stream = await navigator.mediaDevices.getUserMedia(constraints);
} catch (err) {
if (err instanceof Error) {
Expand Down
1 change: 0 additions & 1 deletion src/room/track/LocalTrack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ export default abstract class LocalTrack<
}

private async setMediaStreamTrack(newTrack: MediaStreamTrack, force?: boolean) {
console.trace('setting new media stream track');
if (newTrack === this._mediaStreamTrack && !force) {
return;
}
Expand Down

0 comments on commit 5512f57

Please sign in to comment.