@defcomm/meetingsdk 0.2.9 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +76 -33
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +76 -33
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -220,7 +220,7 @@ declare class VideoSDKCore {
|
|
|
220
220
|
toggleMic(): void;
|
|
221
221
|
toggleCam(): void;
|
|
222
222
|
startScreenShare(): Promise<MediaStream | null>;
|
|
223
|
-
stopScreenShare(): void
|
|
223
|
+
stopScreenShare(): Promise<void>;
|
|
224
224
|
startRecording(): Promise<void>;
|
|
225
225
|
stopRecording(): Promise<void>;
|
|
226
226
|
getRecordingStatus(): Promise<{
|
package/dist/index.d.ts
CHANGED
|
@@ -220,7 +220,7 @@ declare class VideoSDKCore {
|
|
|
220
220
|
toggleMic(): void;
|
|
221
221
|
toggleCam(): void;
|
|
222
222
|
startScreenShare(): Promise<MediaStream | null>;
|
|
223
|
-
stopScreenShare(): void
|
|
223
|
+
stopScreenShare(): Promise<void>;
|
|
224
224
|
startRecording(): Promise<void>;
|
|
225
225
|
stopRecording(): Promise<void>;
|
|
226
226
|
getRecordingStatus(): Promise<{
|
package/dist/index.js
CHANGED
|
@@ -1461,10 +1461,12 @@ var SFUClient = class {
|
|
|
1461
1461
|
}
|
|
1462
1462
|
}
|
|
1463
1463
|
async shareScreen() {
|
|
1464
|
-
if (!this.publisher)
|
|
1464
|
+
if (!this.publisher) {
|
|
1465
1465
|
throw new Error("Publisher PeerConnection is not initialized");
|
|
1466
|
-
|
|
1466
|
+
}
|
|
1467
|
+
if (!this.screenTransceiver || !this.screenSender) {
|
|
1467
1468
|
throw new Error("Screen transceiver is not initialized");
|
|
1469
|
+
}
|
|
1468
1470
|
const existing = this.screenStream;
|
|
1469
1471
|
const existingTrack = this.screenSender.track;
|
|
1470
1472
|
if (existing || existingTrack && existingTrack.readyState === "live") {
|
|
@@ -1489,15 +1491,26 @@ var SFUClient = class {
|
|
|
1489
1491
|
try {
|
|
1490
1492
|
await this.screenSender.replaceTrack(screenTrack);
|
|
1491
1493
|
this.screenTransceiver.direction = "sendonly";
|
|
1492
|
-
this.send({
|
|
1494
|
+
this.send({
|
|
1495
|
+
type: "start_screen_share"
|
|
1496
|
+
});
|
|
1493
1497
|
const offer = await this.publisher.createOffer();
|
|
1494
1498
|
await this.publisher.setLocalDescription(offer);
|
|
1499
|
+
const localDescription = this.publisher.localDescription;
|
|
1500
|
+
if (!localDescription?.sdp) {
|
|
1501
|
+
throw new Error("Publisher did not produce a valid screen-share SDP");
|
|
1502
|
+
}
|
|
1495
1503
|
this.send({
|
|
1496
1504
|
type: "publish_offer",
|
|
1497
|
-
payload: {
|
|
1505
|
+
payload: {
|
|
1506
|
+
revision: ++this.publisherRevision,
|
|
1507
|
+
sdp: localDescription.sdp
|
|
1508
|
+
}
|
|
1498
1509
|
});
|
|
1499
1510
|
screenTrack.onended = () => {
|
|
1500
|
-
if (generation !== this.screenShareGeneration)
|
|
1511
|
+
if (generation !== this.screenShareGeneration) {
|
|
1512
|
+
return;
|
|
1513
|
+
}
|
|
1501
1514
|
void this.stopScreenShare();
|
|
1502
1515
|
};
|
|
1503
1516
|
return this.screenStream;
|
|
@@ -1507,10 +1520,18 @@ var SFUClient = class {
|
|
|
1507
1520
|
} catch {
|
|
1508
1521
|
}
|
|
1509
1522
|
this.screenTransceiver.direction = "inactive";
|
|
1510
|
-
|
|
1523
|
+
screenTrack.onended = null;
|
|
1524
|
+
screenStream.getTracks().forEach((track) => {
|
|
1525
|
+
try {
|
|
1526
|
+
track.stop();
|
|
1527
|
+
} catch {
|
|
1528
|
+
}
|
|
1529
|
+
});
|
|
1511
1530
|
this.screenStream = null;
|
|
1512
1531
|
try {
|
|
1513
|
-
this.send({
|
|
1532
|
+
this.send({
|
|
1533
|
+
type: "stop_screen_share"
|
|
1534
|
+
});
|
|
1514
1535
|
} catch {
|
|
1515
1536
|
}
|
|
1516
1537
|
throw error;
|
|
@@ -1519,32 +1540,52 @@ var SFUClient = class {
|
|
|
1519
1540
|
async stopScreenShare() {
|
|
1520
1541
|
const stream = this.screenStream;
|
|
1521
1542
|
const senderTrack = this.screenSender?.track || null;
|
|
1522
|
-
if (!stream && !senderTrack)
|
|
1543
|
+
if (!stream && !senderTrack) {
|
|
1544
|
+
return;
|
|
1545
|
+
}
|
|
1523
1546
|
++this.screenShareGeneration;
|
|
1524
|
-
if (senderTrack)
|
|
1547
|
+
if (senderTrack) {
|
|
1548
|
+
senderTrack.onended = null;
|
|
1549
|
+
}
|
|
1525
1550
|
try {
|
|
1526
1551
|
await this.screenSender?.replaceTrack(null);
|
|
1527
1552
|
} catch (error) {
|
|
1528
1553
|
this.onError(error);
|
|
1529
1554
|
}
|
|
1530
|
-
if (this.screenTransceiver)
|
|
1555
|
+
if (this.screenTransceiver) {
|
|
1556
|
+
this.screenTransceiver.direction = "inactive";
|
|
1557
|
+
}
|
|
1531
1558
|
try {
|
|
1532
|
-
|
|
1533
|
-
|
|
1559
|
+
if (this.publisher) {
|
|
1560
|
+
const offer = await this.publisher.createOffer();
|
|
1534
1561
|
await this.publisher.setLocalDescription(offer);
|
|
1535
|
-
this.
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1562
|
+
const localDescription = this.publisher.localDescription;
|
|
1563
|
+
if (localDescription?.sdp) {
|
|
1564
|
+
this.send({
|
|
1565
|
+
type: "publish_offer",
|
|
1566
|
+
payload: {
|
|
1567
|
+
revision: ++this.publisherRevision,
|
|
1568
|
+
sdp: localDescription.sdp
|
|
1569
|
+
}
|
|
1570
|
+
});
|
|
1571
|
+
}
|
|
1539
1572
|
}
|
|
1540
1573
|
} catch (error) {
|
|
1541
1574
|
this.onError(error);
|
|
1542
1575
|
}
|
|
1543
|
-
this.send({
|
|
1544
|
-
|
|
1576
|
+
this.send({
|
|
1577
|
+
type: "stop_screen_share"
|
|
1578
|
+
});
|
|
1579
|
+
stream?.getTracks().forEach((track) => {
|
|
1580
|
+
try {
|
|
1581
|
+
track.stop();
|
|
1582
|
+
} catch {
|
|
1583
|
+
}
|
|
1584
|
+
});
|
|
1545
1585
|
this.screenStream = null;
|
|
1546
|
-
if (this.currentParticipantId)
|
|
1586
|
+
if (this.currentParticipantId) {
|
|
1547
1587
|
this.onScreenShareStopped(this.currentParticipantId);
|
|
1588
|
+
}
|
|
1548
1589
|
}
|
|
1549
1590
|
muteAudio(muted) {
|
|
1550
1591
|
this.desiredAudioMuted = muted;
|
|
@@ -1651,7 +1692,7 @@ var SFUClient = class {
|
|
|
1651
1692
|
this.send({
|
|
1652
1693
|
type: "send_reaction",
|
|
1653
1694
|
payload: {
|
|
1654
|
-
reaction
|
|
1695
|
+
emoji: reaction
|
|
1655
1696
|
}
|
|
1656
1697
|
});
|
|
1657
1698
|
}
|
|
@@ -2546,21 +2587,23 @@ var VideoSDKCore = class {
|
|
|
2546
2587
|
throw err;
|
|
2547
2588
|
}
|
|
2548
2589
|
}
|
|
2549
|
-
stopScreenShare() {
|
|
2550
|
-
if (!this.
|
|
2590
|
+
async stopScreenShare() {
|
|
2591
|
+
if (!this.sfuClient) {
|
|
2551
2592
|
return;
|
|
2552
2593
|
}
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2594
|
+
try {
|
|
2595
|
+
await this.sfuClient.stopScreenShare();
|
|
2596
|
+
} finally {
|
|
2597
|
+
this.screenStream = null;
|
|
2598
|
+
this.isScreenSharing = false;
|
|
2599
|
+
this.state.updateLocalParticipant({
|
|
2600
|
+
media: {
|
|
2601
|
+
isScreenSharing: false,
|
|
2602
|
+
screenStream: null,
|
|
2603
|
+
screenTrack: void 0
|
|
2604
|
+
}
|
|
2605
|
+
});
|
|
2606
|
+
}
|
|
2564
2607
|
}
|
|
2565
2608
|
// RECORDING
|
|
2566
2609
|
async startRecording() {
|