Skip to content

Commit 08db2f4

Browse files
fatoldsun00jparez
authored andcommitted
feat(Camera): adding plugin to manage camera injection
1 parent 59e77c6 commit 08db2f4

File tree

14 files changed

+972
-50
lines changed

14 files changed

+972
-50
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"@babel/preset-env": "^7.18.6",
4444
"@fullhuman/postcss-purgecss": "5.0.0",
4545
"@vitest/ui": "^4.0.15",
46+
"@vitejs/plugin-basic-ssl": "^2.1.0",
4647
"autoprefixer": "10.4.14",
4748
"babel-eslint": "^10.1.0",
4849
"eslint": "^7.32.0",

src/DeviceRenderer.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,8 @@ export default class DeviceRenderer {
435435
}
436436
// creating SDP offer
437437
try {
438-
const description = await this.peerConnection.createOffer(this.sdpConstraints);
438+
const description = await this.peerConnection.createOffer();
439+
log.debug('Generated SDP Offer:', description.sdp);
439440
this.setLocalDescription(description);
440441
} catch (error) {
441442
this.onWebRTCConnectionError(error);
@@ -470,6 +471,7 @@ export default class DeviceRenderer {
470471

471472
const config = {
472473
iceServers: iceServers,
474+
bundlePolicy: 'max-compat',
473475
};
474476

475477
if (!this.peerConnection) {
@@ -488,6 +490,11 @@ export default class DeviceRenderer {
488490
this.useWebsocketAsDataChannel = true;
489491
}
490492

493+
// Add transceivers to receive audio and video (VM screen/audio)
494+
// This replaces the legacy offerToReceiveAudio/Video constraints
495+
this.peerConnection.addTransceiver('audio', {direction: 'recvonly'});
496+
this.peerConnection.addTransceiver('video', {direction: 'recvonly'});
497+
491498
this.peerConnection.onicecandidate = (event) => {
492499
if (typeof event.candidate === 'undefined') {
493500
// Nothing we can do
Lines changed: 3 additions & 0 deletions
Loading

src/components/GmDropdown.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export class GmDropdown extends HTMLElement {
156156
if (typeof item === 'string') {
157157
return item;
158158
}
159-
return item.valueToDisplay ?? item.element?.textContent ?? item.value;
159+
return item.label ?? item.valueToDisplay ?? item.element?.textContent ?? item.value;
160160
}
161161

162162
/**
@@ -175,7 +175,7 @@ export class GmDropdown extends HTMLElement {
175175
if (typeof item === 'string') {
176176
display = item;
177177
} else {
178-
display = item.valueToDisplay ?? item.element?.innerHTML ?? item.value;
178+
display = item.label ?? item.valueToDisplay ?? item.element?.innerHTML ?? item.value;
179179
}
180180
}
181181
this.selectedValueDiv.innerHTML = display || 'Select...';
@@ -213,6 +213,8 @@ export class GmDropdown extends HTMLElement {
213213
optionDiv.innerHTML = item;
214214
} else if (item.element instanceof HTMLElement) {
215215
optionDiv.appendChild(item.element);
216+
} else if (item.label || item.valueToDisplay) {
217+
optionDiv.textContent = item.label || item.valueToDisplay;
216218
} else {
217219
return;
218220
}

src/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/*
32
* Import main SCSS file for webpack to process and bundle styles
43
* This ensures all styles are included in the final build

0 commit comments

Comments
 (0)