surflion-service 1.1.3 → 1.1.5
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 +12 -0
package/package.json
CHANGED
package/surflion.js
CHANGED
|
@@ -1498,12 +1498,14 @@ var SurfLion = {
|
|
|
1498
1498
|
});
|
|
1499
1499
|
}
|
|
1500
1500
|
data.session.on('accepted', function (data) {
|
|
1501
|
+
console.log('accepted');
|
|
1501
1502
|
if (data.originator == 'remote' && SurfLion.currentSession == null) {
|
|
1502
1503
|
SurfLion.currentSession = SurfLion.incomingSession;
|
|
1503
1504
|
SurfLion.incomingSession = null;
|
|
1504
1505
|
}
|
|
1505
1506
|
});
|
|
1506
1507
|
data.session.on('confirmed', function (c_data) {
|
|
1508
|
+
console.log('confirmed');
|
|
1507
1509
|
// SurfLion.ringtoneStream.pause();
|
|
1508
1510
|
SurfLion.eventHandlers.confirmed(c_data)
|
|
1509
1511
|
if (c_data.originator == 'remote' && SurfLion.currentSession == null) {
|
|
@@ -1520,15 +1522,25 @@ var SurfLion = {
|
|
|
1520
1522
|
SurfLion.localStream.play();
|
|
1521
1523
|
});
|
|
1522
1524
|
data.session.on("failed", function (data) {
|
|
1525
|
+
console.log('failed');
|
|
1523
1526
|
// SurfLion.ringtoneStream.pause();
|
|
1524
1527
|
SurfLion.incomingSession = null;
|
|
1525
1528
|
SurfLion.eventHandlers.ended(data)
|
|
1526
1529
|
})
|
|
1527
1530
|
data.session.on("ended", function (data) {
|
|
1531
|
+
console.log('ended');
|
|
1528
1532
|
// SurfLion.ringtoneStream.pause();
|
|
1529
1533
|
SurfLion.eventHandlers.ended(data)
|
|
1530
1534
|
})
|
|
1531
1535
|
data.session.on('sdp', function (data) {
|
|
1536
|
+
console.log('sdp');
|
|
1537
|
+
const stream = new MediaStream();
|
|
1538
|
+
const receivers = data.session.connection?.getReceivers();
|
|
1539
|
+
if (receivers) {
|
|
1540
|
+
receivers.forEach((receiver) => stream.addTrack(receiver.track));
|
|
1541
|
+
}
|
|
1542
|
+
SurfLion.localStream.srcObject = stream;
|
|
1543
|
+
SurfLion.localStream.play();
|
|
1532
1544
|
if (SurfLion.debug) {
|
|
1533
1545
|
console.info('onSDP, type - ', data.type, ' sdp - ', data.sdp);
|
|
1534
1546
|
}
|