Skip to content

Commit 71b66bb

Browse files
🔧 chore: update release version and streamline media capture logic
- Updated the application release version in `electron-builder.json5` and `package.json` to `0.0.13` to prepare for the new release. - Simplified media capture logic in `Recorder.tsx` by removing conditional checks for audio and camera sources, ensuring audio and camera streams are always attempted to be captured if specified. This change makes the media capture process more straightforward and reliable.
1 parent ee06675 commit 71b66bb

3 files changed

Lines changed: 25 additions & 33 deletions

File tree

‎apps/desktop/electron-builder.json5‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
afterSign: "electron-builder-notarize",
1010
directories: {
1111
// manually increase due to issue with Windows nsis
12-
output: "release/0.0.10",
12+
output: "release/0.0.13",
1313
buildResources: "build",
1414
},
1515
files: ["dist", "dist-electron"],

‎apps/desktop/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "screenlink-desktop",
33
"private": true,
4-
"version": "0.0.10",
4+
"version": "0.0.13",
55
"author": "Screenlink",
66
"description": "Screenlink Desktop",
77
"scripts": {

‎apps/desktop/src/components/Recorder.tsx‎

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -234,37 +234,33 @@ export function Recorder({
234234
});
235235
setScreenStream(screenStream);
236236

237-
if (audioSource) {
238-
const audioStream = await navigator.mediaDevices.getUserMedia({
239-
audio: {
240-
deviceId: audioSource?.deviceId,
241-
echoCancellation: true,
242-
noiseSuppression: true,
243-
},
244-
});
245-
setAudioStream(audioStream);
246-
}
237+
const audioStream = await navigator.mediaDevices.getUserMedia({
238+
audio: {
239+
deviceId: audioSource?.deviceId,
240+
echoCancellation: true,
241+
noiseSuppression: true,
242+
},
243+
});
244+
setAudioStream(audioStream);
247245

248246
// Capture the camera stream
249-
if (cameraSource) {
250-
const cameraStream = await navigator.mediaDevices.getUserMedia({
251-
video: {
252-
deviceId: cameraSource?.deviceId,
253-
width: 240,
254-
height: 180,
255-
aspectRatio: 1,
256-
facingMode: "user",
257-
frameRate: 60,
258-
},
259-
audio: false,
260-
});
261-
setCameraStream(cameraStream);
262-
}
247+
const cameraStream = await navigator.mediaDevices.getUserMedia({
248+
video: {
249+
deviceId: cameraSource?.deviceId,
250+
width: 240,
251+
height: 180,
252+
aspectRatio: 1,
253+
facingMode: "user",
254+
frameRate: 60,
255+
},
256+
audio: false,
257+
});
258+
setCameraStream(cameraStream);
263259

264260
const combinedStream = new MediaStream([
265261
screenStream.getVideoTracks()[0],
266262
]);
267-
if (audioSource && audioStream) {
263+
if (audioSource) {
268264
combinedStream.addTrack(audioStream.getAudioTracks()[0]);
269265
}
270266

@@ -278,11 +274,7 @@ export function Recorder({
278274
videoRef.current.srcObject = screenStream;
279275

280276
// Entire screen and a camera is selected
281-
if (
282-
selectedSource.sourceType === "window" &&
283-
cameraSource &&
284-
cameraStream
285-
) {
277+
if (selectedSource.sourceType === "window" && cameraSource) {
286278
const cameraRecorder = new MediaRecorder(cameraStream, {
287279
mimeType: "video/webm; codecs=vp9,opus",
288280
});
@@ -445,4 +437,4 @@ export function Recorder({
445437
)}
446438
</div>
447439
);
448-
}
440+
}

0 commit comments

Comments
 (0)