surflion-service 1.0.9 → 1.1.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/package.json +1 -1
- package/surflion.js +26 -12
package/package.json
CHANGED
package/surflion.js
CHANGED
|
@@ -1486,14 +1486,28 @@ var SurfLion = {
|
|
|
1486
1486
|
}
|
|
1487
1487
|
SurfLion.incomingSession = data.session;
|
|
1488
1488
|
SurfLion.eventHandlers.incoming(data)
|
|
1489
|
-
|
|
1489
|
+
const stream = new MediaStream();
|
|
1490
|
+
const receivers = data.session.connection?.getReceivers();
|
|
1491
|
+
if (receivers) {
|
|
1492
|
+
receivers.forEach((receiver) => stream.addTrack(receiver.track));
|
|
1493
|
+
}
|
|
1494
|
+
SurfLion.localStream.srcObject = stream;
|
|
1495
|
+
SurfLion.localStream.play();
|
|
1496
|
+
// SurfLion.ringtoneStream.play();
|
|
1490
1497
|
} else {
|
|
1491
1498
|
SurfLion.outgoingSession = data.session;
|
|
1492
1499
|
SurfLion.outgoingSession.on('connecting', function (data) {
|
|
1493
1500
|
SurfLion.currentSession = SurfLion.outgoingSession;
|
|
1494
1501
|
SurfLion.outgoingSession = null;
|
|
1495
1502
|
SurfLion.eventHandlers.connecting(data)
|
|
1496
|
-
|
|
1503
|
+
const stream = new MediaStream();
|
|
1504
|
+
const receivers = data.session.connection?.getReceivers();
|
|
1505
|
+
if (receivers) {
|
|
1506
|
+
receivers.forEach((receiver) => stream.addTrack(receiver.track));
|
|
1507
|
+
}
|
|
1508
|
+
SurfLion.localStream.srcObject = stream;
|
|
1509
|
+
SurfLion.localStream.play();
|
|
1510
|
+
// SurfLion.ringtoneStream.play();
|
|
1497
1511
|
});
|
|
1498
1512
|
}
|
|
1499
1513
|
data.session.on('accepted', function (data) {
|
|
@@ -1503,28 +1517,28 @@ var SurfLion = {
|
|
|
1503
1517
|
}
|
|
1504
1518
|
});
|
|
1505
1519
|
data.session.on('confirmed', function (c_data) {
|
|
1506
|
-
SurfLion.ringtoneStream.pause();
|
|
1520
|
+
// SurfLion.ringtoneStream.pause();
|
|
1507
1521
|
SurfLion.eventHandlers.confirmed(c_data)
|
|
1508
1522
|
if (c_data.originator == 'remote' && SurfLion.currentSession == null) {
|
|
1509
1523
|
SurfLion.currentSession = SurfLion.incomingSession;
|
|
1510
1524
|
SurfLion.incomingSession = null;
|
|
1511
1525
|
}
|
|
1512
1526
|
|
|
1513
|
-
const stream = new MediaStream();
|
|
1514
|
-
const receivers = data.session.connection?.getReceivers();
|
|
1515
|
-
if (receivers) {
|
|
1516
|
-
|
|
1517
|
-
}
|
|
1518
|
-
SurfLion.localStream.srcObject = stream;
|
|
1519
|
-
SurfLion.localStream.play();
|
|
1527
|
+
// const stream = new MediaStream();
|
|
1528
|
+
// const receivers = data.session.connection?.getReceivers();
|
|
1529
|
+
// if (receivers) {
|
|
1530
|
+
// receivers.forEach((receiver) => stream.addTrack(receiver.track));
|
|
1531
|
+
// }
|
|
1532
|
+
// SurfLion.localStream.srcObject = stream;
|
|
1533
|
+
// SurfLion.localStream.play();
|
|
1520
1534
|
});
|
|
1521
1535
|
data.session.on("failed", function (data) {
|
|
1522
|
-
SurfLion.ringtoneStream.pause();
|
|
1536
|
+
// SurfLion.ringtoneStream.pause();
|
|
1523
1537
|
SurfLion.incomingSession = null;
|
|
1524
1538
|
SurfLion.eventHandlers.ended(data)
|
|
1525
1539
|
})
|
|
1526
1540
|
data.session.on("ended", function (data) {
|
|
1527
|
-
SurfLion.ringtoneStream.pause();
|
|
1541
|
+
// SurfLion.ringtoneStream.pause();
|
|
1528
1542
|
SurfLion.eventHandlers.ended(data)
|
|
1529
1543
|
})
|
|
1530
1544
|
data.session.on('sdp', function (data) {
|