@unwanted/matrix-sdk-mini 34.12.0-1 → 34.12.0-3
Sign up to get free protection for your applications and to get access to all the features.
- package/git-revision.txt +1 -1
- package/lib/@types/event.d.ts +0 -19
- package/lib/@types/event.d.ts.map +1 -1
- package/lib/@types/event.js.map +1 -1
- package/lib/@types/global.d.js +0 -2
- package/lib/@types/global.d.js.map +1 -1
- package/lib/browser-index.d.ts.map +1 -1
- package/lib/browser-index.js +0 -11
- package/lib/browser-index.js.map +1 -1
- package/lib/client.d.ts +2 -1224
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +345 -2826
- package/lib/client.js.map +1 -1
- package/lib/embedded.d.ts +0 -22
- package/lib/embedded.d.ts.map +1 -1
- package/lib/embedded.js +24 -167
- package/lib/embedded.js.map +1 -1
- package/lib/event-mapper.d.ts.map +1 -1
- package/lib/event-mapper.js +0 -4
- package/lib/event-mapper.js.map +1 -1
- package/lib/matrix.d.ts +0 -25
- package/lib/matrix.d.ts.map +1 -1
- package/lib/matrix.js +1 -30
- package/lib/matrix.js.map +1 -1
- package/lib/models/MSC3089Branch.d.ts.map +1 -1
- package/lib/models/MSC3089Branch.js +0 -3
- package/lib/models/MSC3089Branch.js.map +1 -1
- package/lib/models/event.d.ts +0 -94
- package/lib/models/event.d.ts.map +1 -1
- package/lib/models/event.js +0 -274
- package/lib/models/event.js.map +1 -1
- package/lib/models/poll.d.ts.map +1 -1
- package/lib/models/poll.js +1 -5
- package/lib/models/poll.js.map +1 -1
- package/lib/models/relations-container.d.ts.map +1 -1
- package/lib/models/relations-container.js +1 -7
- package/lib/models/relations-container.js.map +1 -1
- package/lib/models/relations.d.ts +0 -1
- package/lib/models/relations.d.ts.map +1 -1
- package/lib/models/relations.js +0 -8
- package/lib/models/relations.js.map +1 -1
- package/lib/models/room-state.d.ts.map +1 -1
- package/lib/models/room-state.js +10 -26
- package/lib/models/room-state.js.map +1 -1
- package/lib/models/room.d.ts +0 -18
- package/lib/models/room.d.ts.map +1 -1
- package/lib/models/room.js +94 -148
- package/lib/models/room.js.map +1 -1
- package/lib/models/thread.d.ts.map +1 -1
- package/lib/models/thread.js +0 -1
- package/lib/models/thread.js.map +1 -1
- package/lib/sliding-sync-sdk.d.ts +2 -3
- package/lib/sliding-sync-sdk.d.ts.map +1 -1
- package/lib/sliding-sync-sdk.js +41 -90
- package/lib/sliding-sync-sdk.js.map +1 -1
- package/lib/sync.d.ts +0 -12
- package/lib/sync.d.ts.map +1 -1
- package/lib/sync.js +1 -73
- package/lib/sync.js.map +1 -1
- package/lib/testing.d.ts +0 -48
- package/lib/testing.d.ts.map +1 -1
- package/lib/testing.js +0 -105
- package/lib/testing.js.map +1 -1
- package/package.json +1 -3
- package/src/@types/event.ts +2 -36
- package/src/@types/global.d.ts +0 -3
- package/src/browser-index.ts +0 -11
- package/src/client.ts +52 -2876
- package/src/embedded.ts +3 -132
- package/src/event-mapper.ts +0 -4
- package/src/matrix.ts +0 -41
- package/src/models/MSC3089Branch.ts +0 -3
- package/src/models/event.ts +0 -289
- package/src/models/poll.ts +0 -6
- package/src/models/relations-container.ts +1 -8
- package/src/models/relations.ts +0 -8
- package/src/models/room-state.ts +2 -8
- package/src/models/room.ts +0 -62
- package/src/models/thread.ts +0 -1
- package/src/sliding-sync-sdk.ts +2 -72
- package/src/sync.ts +1 -98
- package/src/testing.ts +0 -108
- package/lib/@types/crypto.d.ts +0 -47
- package/lib/@types/crypto.d.ts.map +0 -1
- package/lib/@types/crypto.js +0 -1
- package/lib/@types/crypto.js.map +0 -1
- package/lib/@types/matrix-sdk-crypto-wasm.d.js +0 -1
- package/lib/@types/matrix-sdk-crypto-wasm.d.js.map +0 -1
- package/lib/common-crypto/CryptoBackend.d.ts +0 -240
- package/lib/common-crypto/CryptoBackend.d.ts.map +0 -1
- package/lib/common-crypto/CryptoBackend.js +0 -73
- package/lib/common-crypto/CryptoBackend.js.map +0 -1
- package/lib/common-crypto/key-passphrase.d.ts +0 -14
- package/lib/common-crypto/key-passphrase.d.ts.map +0 -1
- package/lib/common-crypto/key-passphrase.js +0 -33
- package/lib/common-crypto/key-passphrase.js.map +0 -1
- package/lib/crypto/CrossSigning.d.ts +0 -184
- package/lib/crypto/CrossSigning.d.ts.map +0 -1
- package/lib/crypto/CrossSigning.js +0 -718
- package/lib/crypto/CrossSigning.js.map +0 -1
- package/lib/crypto/DeviceList.d.ts +0 -216
- package/lib/crypto/DeviceList.d.ts.map +0 -1
- package/lib/crypto/DeviceList.js +0 -892
- package/lib/crypto/DeviceList.js.map +0 -1
- package/lib/crypto/EncryptionSetup.d.ts +0 -152
- package/lib/crypto/EncryptionSetup.d.ts.map +0 -1
- package/lib/crypto/EncryptionSetup.js +0 -356
- package/lib/crypto/EncryptionSetup.js.map +0 -1
- package/lib/crypto/OlmDevice.d.ts +0 -457
- package/lib/crypto/OlmDevice.d.ts.map +0 -1
- package/lib/crypto/OlmDevice.js +0 -1241
- package/lib/crypto/OlmDevice.js.map +0 -1
- package/lib/crypto/OutgoingRoomKeyRequestManager.d.ts +0 -109
- package/lib/crypto/OutgoingRoomKeyRequestManager.d.ts.map +0 -1
- package/lib/crypto/OutgoingRoomKeyRequestManager.js +0 -415
- package/lib/crypto/OutgoingRoomKeyRequestManager.js.map +0 -1
- package/lib/crypto/RoomList.d.ts +0 -26
- package/lib/crypto/RoomList.d.ts.map +0 -1
- package/lib/crypto/RoomList.js +0 -71
- package/lib/crypto/RoomList.js.map +0 -1
- package/lib/crypto/SecretSharing.d.ts +0 -24
- package/lib/crypto/SecretSharing.d.ts.map +0 -1
- package/lib/crypto/SecretSharing.js +0 -194
- package/lib/crypto/SecretSharing.js.map +0 -1
- package/lib/crypto/SecretStorage.d.ts +0 -55
- package/lib/crypto/SecretStorage.d.ts.map +0 -1
- package/lib/crypto/SecretStorage.js +0 -118
- package/lib/crypto/SecretStorage.js.map +0 -1
- package/lib/crypto/aes.d.ts +0 -6
- package/lib/crypto/aes.d.ts.map +0 -1
- package/lib/crypto/aes.js +0 -24
- package/lib/crypto/aes.js.map +0 -1
- package/lib/crypto/algorithms/base.d.ts +0 -156
- package/lib/crypto/algorithms/base.d.ts.map +0 -1
- package/lib/crypto/algorithms/base.js +0 -187
- package/lib/crypto/algorithms/base.js.map +0 -1
- package/lib/crypto/algorithms/index.d.ts +0 -4
- package/lib/crypto/algorithms/index.d.ts.map +0 -1
- package/lib/crypto/algorithms/index.js +0 -20
- package/lib/crypto/algorithms/index.js.map +0 -1
- package/lib/crypto/algorithms/megolm.d.ts +0 -385
- package/lib/crypto/algorithms/megolm.d.ts.map +0 -1
- package/lib/crypto/algorithms/megolm.js +0 -1822
- package/lib/crypto/algorithms/megolm.js.map +0 -1
- package/lib/crypto/algorithms/olm.d.ts +0 -5
- package/lib/crypto/algorithms/olm.d.ts.map +0 -1
- package/lib/crypto/algorithms/olm.js +0 -299
- package/lib/crypto/algorithms/olm.js.map +0 -1
- package/lib/crypto/api.d.ts +0 -32
- package/lib/crypto/api.d.ts.map +0 -1
- package/lib/crypto/api.js +0 -22
- package/lib/crypto/api.js.map +0 -1
- package/lib/crypto/backup.d.ts +0 -227
- package/lib/crypto/backup.d.ts.map +0 -1
- package/lib/crypto/backup.js +0 -824
- package/lib/crypto/backup.js.map +0 -1
- package/lib/crypto/crypto.d.ts +0 -3
- package/lib/crypto/crypto.d.ts.map +0 -1
- package/lib/crypto/crypto.js +0 -19
- package/lib/crypto/crypto.js.map +0 -1
- package/lib/crypto/dehydration.d.ts +0 -34
- package/lib/crypto/dehydration.d.ts.map +0 -1
- package/lib/crypto/dehydration.js +0 -252
- package/lib/crypto/dehydration.js.map +0 -1
- package/lib/crypto/device-converter.d.ts +0 -9
- package/lib/crypto/device-converter.d.ts.map +0 -1
- package/lib/crypto/device-converter.js +0 -42
- package/lib/crypto/device-converter.js.map +0 -1
- package/lib/crypto/deviceinfo.d.ts +0 -99
- package/lib/crypto/deviceinfo.d.ts.map +0 -1
- package/lib/crypto/deviceinfo.js +0 -148
- package/lib/crypto/deviceinfo.js.map +0 -1
- package/lib/crypto/index.d.ts +0 -1209
- package/lib/crypto/index.d.ts.map +0 -1
- package/lib/crypto/index.js +0 -4097
- package/lib/crypto/index.js.map +0 -1
- package/lib/crypto/key_passphrase.d.ts +0 -14
- package/lib/crypto/key_passphrase.d.ts.map +0 -1
- package/lib/crypto/key_passphrase.js +0 -44
- package/lib/crypto/key_passphrase.js.map +0 -1
- package/lib/crypto/keybackup.d.ts +0 -18
- package/lib/crypto/keybackup.d.ts.map +0 -1
- package/lib/crypto/keybackup.js +0 -1
- package/lib/crypto/keybackup.js.map +0 -1
- package/lib/crypto/olmlib.d.ts +0 -129
- package/lib/crypto/olmlib.d.ts.map +0 -1
- package/lib/crypto/olmlib.js +0 -492
- package/lib/crypto/olmlib.js.map +0 -1
- package/lib/crypto/recoverykey.d.ts +0 -2
- package/lib/crypto/recoverykey.d.ts.map +0 -1
- package/lib/crypto/recoverykey.js +0 -19
- package/lib/crypto/recoverykey.js.map +0 -1
- package/lib/crypto/store/base.d.ts +0 -252
- package/lib/crypto/store/base.d.ts.map +0 -1
- package/lib/crypto/store/base.js +0 -64
- package/lib/crypto/store/base.js.map +0 -1
- package/lib/crypto/store/indexeddb-crypto-store-backend.d.ts +0 -187
- package/lib/crypto/store/indexeddb-crypto-store-backend.d.ts.map +0 -1
- package/lib/crypto/store/indexeddb-crypto-store-backend.js +0 -1145
- package/lib/crypto/store/indexeddb-crypto-store-backend.js.map +0 -1
- package/lib/crypto/store/indexeddb-crypto-store.d.ts +0 -432
- package/lib/crypto/store/indexeddb-crypto-store.d.ts.map +0 -1
- package/lib/crypto/store/indexeddb-crypto-store.js +0 -728
- package/lib/crypto/store/indexeddb-crypto-store.js.map +0 -1
- package/lib/crypto/store/localStorage-crypto-store.d.ts +0 -119
- package/lib/crypto/store/localStorage-crypto-store.d.ts.map +0 -1
- package/lib/crypto/store/localStorage-crypto-store.js +0 -531
- package/lib/crypto/store/localStorage-crypto-store.js.map +0 -1
- package/lib/crypto/store/memory-crypto-store.d.ts +0 -215
- package/lib/crypto/store/memory-crypto-store.d.ts.map +0 -1
- package/lib/crypto/store/memory-crypto-store.js +0 -622
- package/lib/crypto/store/memory-crypto-store.js.map +0 -1
- package/lib/crypto/verification/Base.d.ts +0 -105
- package/lib/crypto/verification/Base.d.ts.map +0 -1
- package/lib/crypto/verification/Base.js +0 -372
- package/lib/crypto/verification/Base.js.map +0 -1
- package/lib/crypto/verification/Error.d.ts +0 -35
- package/lib/crypto/verification/Error.d.ts.map +0 -1
- package/lib/crypto/verification/Error.js +0 -86
- package/lib/crypto/verification/Error.js.map +0 -1
- package/lib/crypto/verification/IllegalMethod.d.ts +0 -15
- package/lib/crypto/verification/IllegalMethod.d.ts.map +0 -1
- package/lib/crypto/verification/IllegalMethod.js +0 -43
- package/lib/crypto/verification/IllegalMethod.js.map +0 -1
- package/lib/crypto/verification/QRCode.d.ts +0 -51
- package/lib/crypto/verification/QRCode.d.ts.map +0 -1
- package/lib/crypto/verification/QRCode.js +0 -277
- package/lib/crypto/verification/QRCode.js.map +0 -1
- package/lib/crypto/verification/SAS.d.ts +0 -27
- package/lib/crypto/verification/SAS.d.ts.map +0 -1
- package/lib/crypto/verification/SAS.js +0 -485
- package/lib/crypto/verification/SAS.js.map +0 -1
- package/lib/crypto/verification/SASDecimal.d.ts +0 -8
- package/lib/crypto/verification/SASDecimal.d.ts.map +0 -1
- package/lib/crypto/verification/SASDecimal.js +0 -34
- package/lib/crypto/verification/SASDecimal.js.map +0 -1
- package/lib/crypto/verification/request/Channel.d.ts +0 -18
- package/lib/crypto/verification/request/Channel.d.ts.map +0 -1
- package/lib/crypto/verification/request/Channel.js +0 -1
- package/lib/crypto/verification/request/Channel.js.map +0 -1
- package/lib/crypto/verification/request/InRoomChannel.d.ts +0 -113
- package/lib/crypto/verification/request/InRoomChannel.d.ts.map +0 -1
- package/lib/crypto/verification/request/InRoomChannel.js +0 -351
- package/lib/crypto/verification/request/InRoomChannel.js.map +0 -1
- package/lib/crypto/verification/request/ToDeviceChannel.d.ts +0 -105
- package/lib/crypto/verification/request/ToDeviceChannel.d.ts.map +0 -1
- package/lib/crypto/verification/request/ToDeviceChannel.js +0 -328
- package/lib/crypto/verification/request/ToDeviceChannel.js.map +0 -1
- package/lib/crypto/verification/request/VerificationRequest.d.ts +0 -227
- package/lib/crypto/verification/request/VerificationRequest.d.ts.map +0 -1
- package/lib/crypto/verification/request/VerificationRequest.js +0 -937
- package/lib/crypto/verification/request/VerificationRequest.js.map +0 -1
- package/lib/crypto-api/CryptoEvent.d.ts +0 -69
- package/lib/crypto-api/CryptoEvent.d.ts.map +0 -1
- package/lib/crypto-api/CryptoEvent.js +0 -33
- package/lib/crypto-api/CryptoEvent.js.map +0 -1
- package/lib/crypto-api/CryptoEventHandlerMap.d.ts +0 -16
- package/lib/crypto-api/CryptoEventHandlerMap.d.ts.map +0 -1
- package/lib/crypto-api/CryptoEventHandlerMap.js +0 -22
- package/lib/crypto-api/CryptoEventHandlerMap.js.map +0 -1
- package/lib/crypto-api/index.d.ts +0 -978
- package/lib/crypto-api/index.d.ts.map +0 -1
- package/lib/crypto-api/index.js +0 -304
- package/lib/crypto-api/index.js.map +0 -1
- package/lib/crypto-api/key-passphrase.d.ts +0 -11
- package/lib/crypto-api/key-passphrase.d.ts.map +0 -1
- package/lib/crypto-api/key-passphrase.js +0 -51
- package/lib/crypto-api/key-passphrase.js.map +0 -1
- package/lib/crypto-api/keybackup.d.ts +0 -88
- package/lib/crypto-api/keybackup.d.ts.map +0 -1
- package/lib/crypto-api/keybackup.js +0 -1
- package/lib/crypto-api/keybackup.js.map +0 -1
- package/lib/crypto-api/recovery-key.d.ts +0 -11
- package/lib/crypto-api/recovery-key.d.ts.map +0 -1
- package/lib/crypto-api/recovery-key.js +0 -65
- package/lib/crypto-api/recovery-key.js.map +0 -1
- package/lib/crypto-api/verification.d.ts +0 -344
- package/lib/crypto-api/verification.d.ts.map +0 -1
- package/lib/crypto-api/verification.js +0 -91
- package/lib/crypto-api/verification.js.map +0 -1
- package/lib/matrixrtc/CallMembership.d.ts +0 -66
- package/lib/matrixrtc/CallMembership.d.ts.map +0 -1
- package/lib/matrixrtc/CallMembership.js +0 -197
- package/lib/matrixrtc/CallMembership.js.map +0 -1
- package/lib/matrixrtc/LivekitFocus.d.ts +0 -16
- package/lib/matrixrtc/LivekitFocus.d.ts.map +0 -1
- package/lib/matrixrtc/LivekitFocus.js +0 -20
- package/lib/matrixrtc/LivekitFocus.js.map +0 -1
- package/lib/matrixrtc/MatrixRTCSession.d.ts +0 -295
- package/lib/matrixrtc/MatrixRTCSession.d.ts.map +0 -1
- package/lib/matrixrtc/MatrixRTCSession.js +0 -1043
- package/lib/matrixrtc/MatrixRTCSession.js.map +0 -1
- package/lib/matrixrtc/MatrixRTCSessionManager.d.ts +0 -40
- package/lib/matrixrtc/MatrixRTCSessionManager.d.ts.map +0 -1
- package/lib/matrixrtc/MatrixRTCSessionManager.js +0 -146
- package/lib/matrixrtc/MatrixRTCSessionManager.js.map +0 -1
- package/lib/matrixrtc/focus.d.ts +0 -10
- package/lib/matrixrtc/focus.d.ts.map +0 -1
- package/lib/matrixrtc/focus.js +0 -1
- package/lib/matrixrtc/focus.js.map +0 -1
- package/lib/matrixrtc/index.d.ts +0 -7
- package/lib/matrixrtc/index.d.ts.map +0 -1
- package/lib/matrixrtc/index.js +0 -21
- package/lib/matrixrtc/index.js.map +0 -1
- package/lib/matrixrtc/types.d.ts +0 -19
- package/lib/matrixrtc/types.d.ts.map +0 -1
- package/lib/matrixrtc/types.js +0 -1
- package/lib/matrixrtc/types.js.map +0 -1
- package/lib/rendezvous/MSC4108SignInWithQR.d.ts +0 -112
- package/lib/rendezvous/MSC4108SignInWithQR.d.ts.map +0 -1
- package/lib/rendezvous/MSC4108SignInWithQR.js +0 -392
- package/lib/rendezvous/MSC4108SignInWithQR.js.map +0 -1
- package/lib/rendezvous/RendezvousChannel.d.ts +0 -27
- package/lib/rendezvous/RendezvousChannel.d.ts.map +0 -1
- package/lib/rendezvous/RendezvousChannel.js +0 -1
- package/lib/rendezvous/RendezvousChannel.js.map +0 -1
- package/lib/rendezvous/RendezvousCode.d.ts +0 -9
- package/lib/rendezvous/RendezvousCode.d.ts.map +0 -1
- package/lib/rendezvous/RendezvousCode.js +0 -1
- package/lib/rendezvous/RendezvousCode.js.map +0 -1
- package/lib/rendezvous/RendezvousError.d.ts +0 -6
- package/lib/rendezvous/RendezvousError.d.ts.map +0 -1
- package/lib/rendezvous/RendezvousError.js +0 -23
- package/lib/rendezvous/RendezvousError.js.map +0 -1
- package/lib/rendezvous/RendezvousFailureReason.d.ts +0 -31
- package/lib/rendezvous/RendezvousFailureReason.d.ts.map +0 -1
- package/lib/rendezvous/RendezvousFailureReason.js +0 -38
- package/lib/rendezvous/RendezvousFailureReason.js.map +0 -1
- package/lib/rendezvous/RendezvousIntent.d.ts +0 -5
- package/lib/rendezvous/RendezvousIntent.d.ts.map +0 -1
- package/lib/rendezvous/RendezvousIntent.js +0 -22
- package/lib/rendezvous/RendezvousIntent.js.map +0 -1
- package/lib/rendezvous/RendezvousTransport.d.ts +0 -36
- package/lib/rendezvous/RendezvousTransport.d.ts.map +0 -1
- package/lib/rendezvous/RendezvousTransport.js +0 -1
- package/lib/rendezvous/RendezvousTransport.js.map +0 -1
- package/lib/rendezvous/channels/MSC4108SecureChannel.d.ts +0 -58
- package/lib/rendezvous/channels/MSC4108SecureChannel.d.ts.map +0 -1
- package/lib/rendezvous/channels/MSC4108SecureChannel.js +0 -246
- package/lib/rendezvous/channels/MSC4108SecureChannel.js.map +0 -1
- package/lib/rendezvous/channels/index.d.ts +0 -2
- package/lib/rendezvous/channels/index.d.ts.map +0 -1
- package/lib/rendezvous/channels/index.js +0 -18
- package/lib/rendezvous/channels/index.js.map +0 -1
- package/lib/rendezvous/index.d.ts +0 -10
- package/lib/rendezvous/index.d.ts.map +0 -1
- package/lib/rendezvous/index.js +0 -23
- package/lib/rendezvous/index.js.map +0 -1
- package/lib/rendezvous/transports/MSC4108RendezvousSession.d.ts +0 -61
- package/lib/rendezvous/transports/MSC4108RendezvousSession.d.ts.map +0 -1
- package/lib/rendezvous/transports/MSC4108RendezvousSession.js +0 -253
- package/lib/rendezvous/transports/MSC4108RendezvousSession.js.map +0 -1
- package/lib/rendezvous/transports/index.d.ts +0 -2
- package/lib/rendezvous/transports/index.d.ts.map +0 -1
- package/lib/rendezvous/transports/index.js +0 -18
- package/lib/rendezvous/transports/index.js.map +0 -1
- package/lib/rust-crypto/CrossSigningIdentity.d.ts +0 -33
- package/lib/rust-crypto/CrossSigningIdentity.d.ts.map +0 -1
- package/lib/rust-crypto/CrossSigningIdentity.js +0 -157
- package/lib/rust-crypto/CrossSigningIdentity.js.map +0 -1
- package/lib/rust-crypto/DehydratedDeviceManager.d.ts +0 -98
- package/lib/rust-crypto/DehydratedDeviceManager.d.ts.map +0 -1
- package/lib/rust-crypto/DehydratedDeviceManager.js +0 -285
- package/lib/rust-crypto/DehydratedDeviceManager.js.map +0 -1
- package/lib/rust-crypto/KeyClaimManager.d.ts +0 -33
- package/lib/rust-crypto/KeyClaimManager.d.ts.map +0 -1
- package/lib/rust-crypto/KeyClaimManager.js +0 -82
- package/lib/rust-crypto/KeyClaimManager.js.map +0 -1
- package/lib/rust-crypto/OutgoingRequestProcessor.d.ts +0 -43
- package/lib/rust-crypto/OutgoingRequestProcessor.d.ts.map +0 -1
- package/lib/rust-crypto/OutgoingRequestProcessor.js +0 -195
- package/lib/rust-crypto/OutgoingRequestProcessor.js.map +0 -1
- package/lib/rust-crypto/OutgoingRequestsManager.d.ts +0 -47
- package/lib/rust-crypto/OutgoingRequestsManager.d.ts.map +0 -1
- package/lib/rust-crypto/OutgoingRequestsManager.js +0 -148
- package/lib/rust-crypto/OutgoingRequestsManager.js.map +0 -1
- package/lib/rust-crypto/PerSessionKeyBackupDownloader.d.ts +0 -120
- package/lib/rust-crypto/PerSessionKeyBackupDownloader.d.ts.map +0 -1
- package/lib/rust-crypto/PerSessionKeyBackupDownloader.js +0 -467
- package/lib/rust-crypto/PerSessionKeyBackupDownloader.js.map +0 -1
- package/lib/rust-crypto/RoomEncryptor.d.ts +0 -98
- package/lib/rust-crypto/RoomEncryptor.d.ts.map +0 -1
- package/lib/rust-crypto/RoomEncryptor.js +0 -299
- package/lib/rust-crypto/RoomEncryptor.js.map +0 -1
- package/lib/rust-crypto/backup.d.ts +0 -254
- package/lib/rust-crypto/backup.d.ts.map +0 -1
- package/lib/rust-crypto/backup.js +0 -837
- package/lib/rust-crypto/backup.js.map +0 -1
- package/lib/rust-crypto/constants.d.ts +0 -3
- package/lib/rust-crypto/constants.d.ts.map +0 -1
- package/lib/rust-crypto/constants.js +0 -19
- package/lib/rust-crypto/constants.js.map +0 -1
- package/lib/rust-crypto/device-converter.d.ts +0 -28
- package/lib/rust-crypto/device-converter.d.ts.map +0 -1
- package/lib/rust-crypto/device-converter.js +0 -123
- package/lib/rust-crypto/device-converter.js.map +0 -1
- package/lib/rust-crypto/index.d.ts +0 -61
- package/lib/rust-crypto/index.d.ts.map +0 -1
- package/lib/rust-crypto/index.js +0 -152
- package/lib/rust-crypto/index.js.map +0 -1
- package/lib/rust-crypto/libolm_migration.d.ts +0 -81
- package/lib/rust-crypto/libolm_migration.d.ts.map +0 -1
- package/lib/rust-crypto/libolm_migration.js +0 -459
- package/lib/rust-crypto/libolm_migration.js.map +0 -1
- package/lib/rust-crypto/rust-crypto.d.ts +0 -556
- package/lib/rust-crypto/rust-crypto.d.ts.map +0 -1
- package/lib/rust-crypto/rust-crypto.js +0 -2016
- package/lib/rust-crypto/rust-crypto.js.map +0 -1
- package/lib/rust-crypto/secret-storage.d.ts +0 -22
- package/lib/rust-crypto/secret-storage.d.ts.map +0 -1
- package/lib/rust-crypto/secret-storage.js +0 -63
- package/lib/rust-crypto/secret-storage.js.map +0 -1
- package/lib/rust-crypto/verification.d.ts +0 -319
- package/lib/rust-crypto/verification.d.ts.map +0 -1
- package/lib/rust-crypto/verification.js +0 -816
- package/lib/rust-crypto/verification.js.map +0 -1
- package/lib/secret-storage.d.ts +0 -370
- package/lib/secret-storage.d.ts.map +0 -1
- package/lib/secret-storage.js +0 -466
- package/lib/secret-storage.js.map +0 -1
- package/lib/webrtc/audioContext.d.ts +0 -15
- package/lib/webrtc/audioContext.d.ts.map +0 -1
- package/lib/webrtc/audioContext.js +0 -46
- package/lib/webrtc/audioContext.js.map +0 -1
- package/lib/webrtc/call.d.ts +0 -560
- package/lib/webrtc/call.d.ts.map +0 -1
- package/lib/webrtc/call.js +0 -2541
- package/lib/webrtc/call.js.map +0 -1
- package/lib/webrtc/callEventHandler.d.ts +0 -37
- package/lib/webrtc/callEventHandler.d.ts.map +0 -1
- package/lib/webrtc/callEventHandler.js +0 -344
- package/lib/webrtc/callEventHandler.js.map +0 -1
- package/lib/webrtc/callEventTypes.d.ts +0 -73
- package/lib/webrtc/callEventTypes.d.ts.map +0 -1
- package/lib/webrtc/callEventTypes.js +0 -13
- package/lib/webrtc/callEventTypes.js.map +0 -1
- package/lib/webrtc/callFeed.d.ts +0 -128
- package/lib/webrtc/callFeed.d.ts.map +0 -1
- package/lib/webrtc/callFeed.js +0 -289
- package/lib/webrtc/callFeed.js.map +0 -1
- package/lib/webrtc/groupCall.d.ts +0 -323
- package/lib/webrtc/groupCall.d.ts.map +0 -1
- package/lib/webrtc/groupCall.js +0 -1337
- package/lib/webrtc/groupCall.js.map +0 -1
- package/lib/webrtc/groupCallEventHandler.d.ts +0 -31
- package/lib/webrtc/groupCallEventHandler.d.ts.map +0 -1
- package/lib/webrtc/groupCallEventHandler.js +0 -178
- package/lib/webrtc/groupCallEventHandler.js.map +0 -1
- package/lib/webrtc/mediaHandler.d.ts +0 -89
- package/lib/webrtc/mediaHandler.d.ts.map +0 -1
- package/lib/webrtc/mediaHandler.js +0 -437
- package/lib/webrtc/mediaHandler.js.map +0 -1
- package/lib/webrtc/stats/callFeedStatsReporter.d.ts +0 -8
- package/lib/webrtc/stats/callFeedStatsReporter.d.ts.map +0 -1
- package/lib/webrtc/stats/callFeedStatsReporter.js +0 -82
- package/lib/webrtc/stats/callFeedStatsReporter.js.map +0 -1
- package/lib/webrtc/stats/callStatsReportGatherer.d.ts +0 -25
- package/lib/webrtc/stats/callStatsReportGatherer.d.ts.map +0 -1
- package/lib/webrtc/stats/callStatsReportGatherer.js +0 -199
- package/lib/webrtc/stats/callStatsReportGatherer.js.map +0 -1
- package/lib/webrtc/stats/callStatsReportSummary.d.ts +0 -17
- package/lib/webrtc/stats/callStatsReportSummary.d.ts.map +0 -1
- package/lib/webrtc/stats/callStatsReportSummary.js +0 -1
- package/lib/webrtc/stats/callStatsReportSummary.js.map +0 -1
- package/lib/webrtc/stats/connectionStats.d.ts +0 -28
- package/lib/webrtc/stats/connectionStats.d.ts.map +0 -1
- package/lib/webrtc/stats/connectionStats.js +0 -26
- package/lib/webrtc/stats/connectionStats.js.map +0 -1
- package/lib/webrtc/stats/connectionStatsBuilder.d.ts +0 -5
- package/lib/webrtc/stats/connectionStatsBuilder.d.ts.map +0 -1
- package/lib/webrtc/stats/connectionStatsBuilder.js +0 -27
- package/lib/webrtc/stats/connectionStatsBuilder.js.map +0 -1
- package/lib/webrtc/stats/connectionStatsReportBuilder.d.ts +0 -7
- package/lib/webrtc/stats/connectionStatsReportBuilder.d.ts.map +0 -1
- package/lib/webrtc/stats/connectionStatsReportBuilder.js +0 -121
- package/lib/webrtc/stats/connectionStatsReportBuilder.js.map +0 -1
- package/lib/webrtc/stats/groupCallStats.d.ts +0 -22
- package/lib/webrtc/stats/groupCallStats.d.ts.map +0 -1
- package/lib/webrtc/stats/groupCallStats.js +0 -78
- package/lib/webrtc/stats/groupCallStats.js.map +0 -1
- package/lib/webrtc/stats/media/mediaSsrcHandler.d.ts +0 -10
- package/lib/webrtc/stats/media/mediaSsrcHandler.d.ts.map +0 -1
- package/lib/webrtc/stats/media/mediaSsrcHandler.js +0 -57
- package/lib/webrtc/stats/media/mediaSsrcHandler.js.map +0 -1
- package/lib/webrtc/stats/media/mediaTrackHandler.d.ts +0 -12
- package/lib/webrtc/stats/media/mediaTrackHandler.d.ts.map +0 -1
- package/lib/webrtc/stats/media/mediaTrackHandler.js +0 -62
- package/lib/webrtc/stats/media/mediaTrackHandler.js.map +0 -1
- package/lib/webrtc/stats/media/mediaTrackStats.d.ts +0 -86
- package/lib/webrtc/stats/media/mediaTrackStats.d.ts.map +0 -1
- package/lib/webrtc/stats/media/mediaTrackStats.js +0 -142
- package/lib/webrtc/stats/media/mediaTrackStats.js.map +0 -1
- package/lib/webrtc/stats/media/mediaTrackStatsHandler.d.ts +0 -22
- package/lib/webrtc/stats/media/mediaTrackStatsHandler.d.ts.map +0 -1
- package/lib/webrtc/stats/media/mediaTrackStatsHandler.js +0 -76
- package/lib/webrtc/stats/media/mediaTrackStatsHandler.js.map +0 -1
- package/lib/webrtc/stats/statsReport.d.ts +0 -99
- package/lib/webrtc/stats/statsReport.d.ts.map +0 -1
- package/lib/webrtc/stats/statsReport.js +0 -32
- package/lib/webrtc/stats/statsReport.js.map +0 -1
- package/lib/webrtc/stats/statsReportEmitter.d.ts +0 -15
- package/lib/webrtc/stats/statsReportEmitter.d.ts.map +0 -1
- package/lib/webrtc/stats/statsReportEmitter.js +0 -33
- package/lib/webrtc/stats/statsReportEmitter.js.map +0 -1
- package/lib/webrtc/stats/summaryStatsReportGatherer.d.ts +0 -16
- package/lib/webrtc/stats/summaryStatsReportGatherer.d.ts.map +0 -1
- package/lib/webrtc/stats/summaryStatsReportGatherer.js +0 -116
- package/lib/webrtc/stats/summaryStatsReportGatherer.js.map +0 -1
- package/lib/webrtc/stats/trackStatsBuilder.d.ts +0 -19
- package/lib/webrtc/stats/trackStatsBuilder.d.ts.map +0 -1
- package/lib/webrtc/stats/trackStatsBuilder.js +0 -168
- package/lib/webrtc/stats/trackStatsBuilder.js.map +0 -1
- package/lib/webrtc/stats/transportStats.d.ts +0 -11
- package/lib/webrtc/stats/transportStats.d.ts.map +0 -1
- package/lib/webrtc/stats/transportStats.js +0 -1
- package/lib/webrtc/stats/transportStats.js.map +0 -1
- package/lib/webrtc/stats/transportStatsBuilder.d.ts +0 -5
- package/lib/webrtc/stats/transportStatsBuilder.d.ts.map +0 -1
- package/lib/webrtc/stats/transportStatsBuilder.js +0 -34
- package/lib/webrtc/stats/transportStatsBuilder.js.map +0 -1
- package/lib/webrtc/stats/valueFormatter.d.ts +0 -4
- package/lib/webrtc/stats/valueFormatter.d.ts.map +0 -1
- package/lib/webrtc/stats/valueFormatter.js +0 -25
- package/lib/webrtc/stats/valueFormatter.js.map +0 -1
- package/src/@types/crypto.ts +0 -73
- package/src/@types/matrix-sdk-crypto-wasm.d.ts +0 -44
- package/src/common-crypto/CryptoBackend.ts +0 -302
- package/src/common-crypto/README.md +0 -4
- package/src/common-crypto/key-passphrase.ts +0 -43
- package/src/crypto/CrossSigning.ts +0 -773
- package/src/crypto/DeviceList.ts +0 -989
- package/src/crypto/EncryptionSetup.ts +0 -351
- package/src/crypto/OlmDevice.ts +0 -1500
- package/src/crypto/OutgoingRoomKeyRequestManager.ts +0 -485
- package/src/crypto/RoomList.ts +0 -70
- package/src/crypto/SecretSharing.ts +0 -240
- package/src/crypto/SecretStorage.ts +0 -136
- package/src/crypto/aes.ts +0 -23
- package/src/crypto/algorithms/base.ts +0 -236
- package/src/crypto/algorithms/index.ts +0 -20
- package/src/crypto/algorithms/megolm.ts +0 -2216
- package/src/crypto/algorithms/olm.ts +0 -381
- package/src/crypto/api.ts +0 -70
- package/src/crypto/backup.ts +0 -922
- package/src/crypto/crypto.ts +0 -18
- package/src/crypto/dehydration.ts +0 -272
- package/src/crypto/device-converter.ts +0 -45
- package/src/crypto/deviceinfo.ts +0 -158
- package/src/crypto/index.ts +0 -4414
- package/src/crypto/key_passphrase.ts +0 -42
- package/src/crypto/keybackup.ts +0 -47
- package/src/crypto/olmlib.ts +0 -539
- package/src/crypto/recoverykey.ts +0 -18
- package/src/crypto/store/base.ts +0 -348
- package/src/crypto/store/indexeddb-crypto-store-backend.ts +0 -1250
- package/src/crypto/store/indexeddb-crypto-store.ts +0 -845
- package/src/crypto/store/localStorage-crypto-store.ts +0 -579
- package/src/crypto/store/memory-crypto-store.ts +0 -680
- package/src/crypto/verification/Base.ts +0 -409
- package/src/crypto/verification/Error.ts +0 -76
- package/src/crypto/verification/IllegalMethod.ts +0 -50
- package/src/crypto/verification/QRCode.ts +0 -310
- package/src/crypto/verification/SAS.ts +0 -494
- package/src/crypto/verification/SASDecimal.ts +0 -37
- package/src/crypto/verification/request/Channel.ts +0 -34
- package/src/crypto/verification/request/InRoomChannel.ts +0 -371
- package/src/crypto/verification/request/ToDeviceChannel.ts +0 -354
- package/src/crypto/verification/request/VerificationRequest.ts +0 -976
- package/src/crypto-api/CryptoEvent.ts +0 -93
- package/src/crypto-api/CryptoEventHandlerMap.ts +0 -32
- package/src/crypto-api/index.ts +0 -1175
- package/src/crypto-api/key-passphrase.ts +0 -58
- package/src/crypto-api/keybackup.ts +0 -115
- package/src/crypto-api/recovery-key.ts +0 -69
- package/src/crypto-api/verification.ts +0 -408
- package/src/matrixrtc/CallMembership.ts +0 -247
- package/src/matrixrtc/LivekitFocus.ts +0 -39
- package/src/matrixrtc/MatrixRTCSession.ts +0 -1319
- package/src/matrixrtc/MatrixRTCSessionManager.ts +0 -166
- package/src/matrixrtc/focus.ts +0 -25
- package/src/matrixrtc/index.ts +0 -22
- package/src/matrixrtc/types.ts +0 -36
- package/src/rendezvous/MSC4108SignInWithQR.ts +0 -444
- package/src/rendezvous/RendezvousChannel.ts +0 -48
- package/src/rendezvous/RendezvousCode.ts +0 -25
- package/src/rendezvous/RendezvousError.ts +0 -26
- package/src/rendezvous/RendezvousFailureReason.ts +0 -49
- package/src/rendezvous/RendezvousIntent.ts +0 -20
- package/src/rendezvous/RendezvousTransport.ts +0 -58
- package/src/rendezvous/channels/MSC4108SecureChannel.ts +0 -270
- package/src/rendezvous/channels/index.ts +0 -17
- package/src/rendezvous/index.ts +0 -25
- package/src/rendezvous/transports/MSC4108RendezvousSession.ts +0 -270
- package/src/rendezvous/transports/index.ts +0 -17
- package/src/rust-crypto/CrossSigningIdentity.ts +0 -183
- package/src/rust-crypto/DehydratedDeviceManager.ts +0 -306
- package/src/rust-crypto/KeyClaimManager.ts +0 -86
- package/src/rust-crypto/OutgoingRequestProcessor.ts +0 -236
- package/src/rust-crypto/OutgoingRequestsManager.ts +0 -143
- package/src/rust-crypto/PerSessionKeyBackupDownloader.ts +0 -501
- package/src/rust-crypto/RoomEncryptor.ts +0 -352
- package/src/rust-crypto/backup.ts +0 -881
- package/src/rust-crypto/constants.ts +0 -18
- package/src/rust-crypto/device-converter.ts +0 -128
- package/src/rust-crypto/index.ts +0 -237
- package/src/rust-crypto/libolm_migration.ts +0 -530
- package/src/rust-crypto/rust-crypto.ts +0 -2205
- package/src/rust-crypto/secret-storage.ts +0 -60
- package/src/rust-crypto/verification.ts +0 -830
- package/src/secret-storage.ts +0 -693
- package/src/webrtc/audioContext.ts +0 -44
- package/src/webrtc/call.ts +0 -3074
- package/src/webrtc/callEventHandler.ts +0 -425
- package/src/webrtc/callEventTypes.ts +0 -93
- package/src/webrtc/callFeed.ts +0 -364
- package/src/webrtc/groupCall.ts +0 -1735
- package/src/webrtc/groupCallEventHandler.ts +0 -234
- package/src/webrtc/mediaHandler.ts +0 -484
- package/src/webrtc/stats/callFeedStatsReporter.ts +0 -94
- package/src/webrtc/stats/callStatsReportGatherer.ts +0 -219
- package/src/webrtc/stats/callStatsReportSummary.ts +0 -30
- package/src/webrtc/stats/connectionStats.ts +0 -47
- package/src/webrtc/stats/connectionStatsBuilder.ts +0 -28
- package/src/webrtc/stats/connectionStatsReportBuilder.ts +0 -140
- package/src/webrtc/stats/groupCallStats.ts +0 -93
- package/src/webrtc/stats/media/mediaSsrcHandler.ts +0 -57
- package/src/webrtc/stats/media/mediaTrackHandler.ts +0 -76
- package/src/webrtc/stats/media/mediaTrackStats.ts +0 -176
- package/src/webrtc/stats/media/mediaTrackStatsHandler.ts +0 -90
- package/src/webrtc/stats/statsReport.ts +0 -133
- package/src/webrtc/stats/statsReportEmitter.ts +0 -49
- package/src/webrtc/stats/summaryStatsReportGatherer.ts +0 -148
- package/src/webrtc/stats/trackStatsBuilder.ts +0 -207
- package/src/webrtc/stats/transportStats.ts +0 -26
- package/src/webrtc/stats/transportStatsBuilder.ts +0 -48
- package/src/webrtc/stats/valueFormatter.ts +0 -27
package/lib/webrtc/callFeed.js
DELETED
@@ -1,289 +0,0 @@
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
2
|
-
/*
|
3
|
-
Copyright 2021 Šimon Brandner <simon.bra.ag@gmail.com>
|
4
|
-
|
5
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
-
you may not use this file except in compliance with the License.
|
7
|
-
You may obtain a copy of the License at
|
8
|
-
|
9
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
10
|
-
|
11
|
-
Unless required by applicable law or agreed to in writing, software
|
12
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
-
See the License for the specific language governing permissions and
|
15
|
-
limitations under the License.
|
16
|
-
*/
|
17
|
-
|
18
|
-
import { SDPStreamMetadataPurpose } from "./callEventTypes.js";
|
19
|
-
import { acquireContext, releaseContext } from "./audioContext.js";
|
20
|
-
import { logger } from "../logger.js";
|
21
|
-
import { TypedEventEmitter } from "../models/typed-event-emitter.js";
|
22
|
-
import { CallEvent, CallState } from "./call.js";
|
23
|
-
var POLLING_INTERVAL = 200; // ms
|
24
|
-
export var SPEAKING_THRESHOLD = -60; // dB
|
25
|
-
var SPEAKING_SAMPLE_COUNT = 8; // samples
|
26
|
-
|
27
|
-
export var CallFeedEvent = /*#__PURE__*/function (CallFeedEvent) {
|
28
|
-
CallFeedEvent["NewStream"] = "new_stream";
|
29
|
-
CallFeedEvent["MuteStateChanged"] = "mute_state_changed";
|
30
|
-
CallFeedEvent["LocalVolumeChanged"] = "local_volume_changed";
|
31
|
-
CallFeedEvent["VolumeChanged"] = "volume_changed";
|
32
|
-
CallFeedEvent["ConnectedChanged"] = "connected_changed";
|
33
|
-
CallFeedEvent["Speaking"] = "speaking";
|
34
|
-
CallFeedEvent["Disposed"] = "disposed";
|
35
|
-
return CallFeedEvent;
|
36
|
-
}({});
|
37
|
-
export class CallFeed extends TypedEventEmitter {
|
38
|
-
constructor(opts) {
|
39
|
-
super();
|
40
|
-
_defineProperty(this, "stream", void 0);
|
41
|
-
_defineProperty(this, "sdpMetadataStreamId", void 0);
|
42
|
-
_defineProperty(this, "userId", void 0);
|
43
|
-
_defineProperty(this, "deviceId", void 0);
|
44
|
-
_defineProperty(this, "purpose", void 0);
|
45
|
-
_defineProperty(this, "speakingVolumeSamples", void 0);
|
46
|
-
_defineProperty(this, "client", void 0);
|
47
|
-
_defineProperty(this, "call", void 0);
|
48
|
-
_defineProperty(this, "roomId", void 0);
|
49
|
-
_defineProperty(this, "audioMuted", void 0);
|
50
|
-
_defineProperty(this, "videoMuted", void 0);
|
51
|
-
_defineProperty(this, "localVolume", 1);
|
52
|
-
_defineProperty(this, "measuringVolumeActivity", false);
|
53
|
-
_defineProperty(this, "audioContext", void 0);
|
54
|
-
_defineProperty(this, "analyser", void 0);
|
55
|
-
_defineProperty(this, "frequencyBinCount", void 0);
|
56
|
-
_defineProperty(this, "speakingThreshold", SPEAKING_THRESHOLD);
|
57
|
-
_defineProperty(this, "speaking", false);
|
58
|
-
_defineProperty(this, "volumeLooperTimeout", void 0);
|
59
|
-
_defineProperty(this, "_disposed", false);
|
60
|
-
_defineProperty(this, "_connected", false);
|
61
|
-
_defineProperty(this, "onAddTrack", () => {
|
62
|
-
this.emit(CallFeedEvent.NewStream, this.stream);
|
63
|
-
});
|
64
|
-
_defineProperty(this, "onCallState", state => {
|
65
|
-
if (state === CallState.Connected) {
|
66
|
-
this.connected = true;
|
67
|
-
} else if (state === CallState.Connecting) {
|
68
|
-
this.connected = false;
|
69
|
-
}
|
70
|
-
});
|
71
|
-
_defineProperty(this, "volumeLooper", () => {
|
72
|
-
if (!this.analyser) return;
|
73
|
-
if (!this.measuringVolumeActivity) return;
|
74
|
-
this.analyser.getFloatFrequencyData(this.frequencyBinCount);
|
75
|
-
var maxVolume = -Infinity;
|
76
|
-
for (var volume of this.frequencyBinCount) {
|
77
|
-
if (volume > maxVolume) {
|
78
|
-
maxVolume = volume;
|
79
|
-
}
|
80
|
-
}
|
81
|
-
this.speakingVolumeSamples.shift();
|
82
|
-
this.speakingVolumeSamples.push(maxVolume);
|
83
|
-
this.emit(CallFeedEvent.VolumeChanged, maxVolume);
|
84
|
-
var newSpeaking = false;
|
85
|
-
for (var _volume of this.speakingVolumeSamples) {
|
86
|
-
if (_volume > this.speakingThreshold) {
|
87
|
-
newSpeaking = true;
|
88
|
-
break;
|
89
|
-
}
|
90
|
-
}
|
91
|
-
if (this.speaking !== newSpeaking) {
|
92
|
-
this.speaking = newSpeaking;
|
93
|
-
this.emit(CallFeedEvent.Speaking, this.speaking);
|
94
|
-
}
|
95
|
-
this.volumeLooperTimeout = setTimeout(this.volumeLooper, POLLING_INTERVAL);
|
96
|
-
});
|
97
|
-
this.client = opts.client;
|
98
|
-
this.call = opts.call;
|
99
|
-
this.roomId = opts.roomId;
|
100
|
-
this.userId = opts.userId;
|
101
|
-
this.deviceId = opts.deviceId;
|
102
|
-
this.purpose = opts.purpose;
|
103
|
-
this.audioMuted = opts.audioMuted;
|
104
|
-
this.videoMuted = opts.videoMuted;
|
105
|
-
this.speakingVolumeSamples = new Array(SPEAKING_SAMPLE_COUNT).fill(-Infinity);
|
106
|
-
this.sdpMetadataStreamId = opts.stream.id;
|
107
|
-
this.updateStream(null, opts.stream);
|
108
|
-
this.stream = opts.stream; // updateStream does this, but this makes TS happier
|
109
|
-
|
110
|
-
if (this.hasAudioTrack) {
|
111
|
-
this.initVolumeMeasuring();
|
112
|
-
}
|
113
|
-
if (opts.call) {
|
114
|
-
opts.call.addListener(CallEvent.State, this.onCallState);
|
115
|
-
this.onCallState(opts.call.state);
|
116
|
-
}
|
117
|
-
}
|
118
|
-
get connected() {
|
119
|
-
// Local feeds are always considered connected
|
120
|
-
return this.isLocal() || this._connected;
|
121
|
-
}
|
122
|
-
set connected(connected) {
|
123
|
-
this._connected = connected;
|
124
|
-
this.emit(CallFeedEvent.ConnectedChanged, this.connected);
|
125
|
-
}
|
126
|
-
get hasAudioTrack() {
|
127
|
-
return this.stream.getAudioTracks().length > 0;
|
128
|
-
}
|
129
|
-
updateStream(oldStream, newStream) {
|
130
|
-
if (newStream === oldStream) return;
|
131
|
-
var wasMeasuringVolumeActivity = this.measuringVolumeActivity;
|
132
|
-
if (oldStream) {
|
133
|
-
oldStream.removeEventListener("addtrack", this.onAddTrack);
|
134
|
-
this.measureVolumeActivity(false);
|
135
|
-
}
|
136
|
-
this.stream = newStream;
|
137
|
-
newStream.addEventListener("addtrack", this.onAddTrack);
|
138
|
-
if (this.hasAudioTrack) {
|
139
|
-
this.initVolumeMeasuring();
|
140
|
-
if (wasMeasuringVolumeActivity) this.measureVolumeActivity(true);
|
141
|
-
} else {
|
142
|
-
this.measureVolumeActivity(false);
|
143
|
-
}
|
144
|
-
this.emit(CallFeedEvent.NewStream, this.stream);
|
145
|
-
}
|
146
|
-
initVolumeMeasuring() {
|
147
|
-
if (!this.hasAudioTrack) return;
|
148
|
-
if (!this.audioContext) this.audioContext = acquireContext();
|
149
|
-
this.analyser = this.audioContext.createAnalyser();
|
150
|
-
this.analyser.fftSize = 512;
|
151
|
-
this.analyser.smoothingTimeConstant = 0.1;
|
152
|
-
var mediaStreamAudioSourceNode = this.audioContext.createMediaStreamSource(this.stream);
|
153
|
-
mediaStreamAudioSourceNode.connect(this.analyser);
|
154
|
-
this.frequencyBinCount = new Float32Array(this.analyser.frequencyBinCount);
|
155
|
-
}
|
156
|
-
/**
|
157
|
-
* Returns callRoom member
|
158
|
-
* @returns member of the callRoom
|
159
|
-
*/
|
160
|
-
getMember() {
|
161
|
-
var _callRoom$getMember;
|
162
|
-
var callRoom = this.client.getRoom(this.roomId);
|
163
|
-
return (_callRoom$getMember = callRoom === null || callRoom === void 0 ? void 0 : callRoom.getMember(this.userId)) !== null && _callRoom$getMember !== void 0 ? _callRoom$getMember : null;
|
164
|
-
}
|
165
|
-
|
166
|
-
/**
|
167
|
-
* Returns true if CallFeed is local, otherwise returns false
|
168
|
-
* @returns is local?
|
169
|
-
*/
|
170
|
-
isLocal() {
|
171
|
-
return this.userId === this.client.getUserId() && (this.deviceId === undefined || this.deviceId === this.client.getDeviceId());
|
172
|
-
}
|
173
|
-
|
174
|
-
/**
|
175
|
-
* Returns true if audio is muted or if there are no audio
|
176
|
-
* tracks, otherwise returns false
|
177
|
-
* @returns is audio muted?
|
178
|
-
*/
|
179
|
-
isAudioMuted() {
|
180
|
-
return this.stream.getAudioTracks().length === 0 || this.audioMuted;
|
181
|
-
}
|
182
|
-
|
183
|
-
/**
|
184
|
-
* Returns true video is muted or if there are no video
|
185
|
-
* tracks, otherwise returns false
|
186
|
-
* @returns is video muted?
|
187
|
-
*/
|
188
|
-
isVideoMuted() {
|
189
|
-
// We assume only one video track
|
190
|
-
return this.stream.getVideoTracks().length === 0 || this.videoMuted;
|
191
|
-
}
|
192
|
-
isSpeaking() {
|
193
|
-
return this.speaking;
|
194
|
-
}
|
195
|
-
|
196
|
-
/**
|
197
|
-
* Replaces the current MediaStream with a new one.
|
198
|
-
* The stream will be different and new stream as remote parties are
|
199
|
-
* concerned, but this can be used for convenience locally to set up
|
200
|
-
* volume listeners automatically on the new stream etc.
|
201
|
-
* @param newStream - new stream with which to replace the current one
|
202
|
-
*/
|
203
|
-
setNewStream(newStream) {
|
204
|
-
this.updateStream(this.stream, newStream);
|
205
|
-
}
|
206
|
-
|
207
|
-
/**
|
208
|
-
* Set one or both of feed's internal audio and video video mute state
|
209
|
-
* Either value may be null to leave it as-is
|
210
|
-
* @param audioMuted - is the feed's audio muted?
|
211
|
-
* @param videoMuted - is the feed's video muted?
|
212
|
-
*/
|
213
|
-
setAudioVideoMuted(audioMuted, videoMuted) {
|
214
|
-
if (audioMuted !== null) {
|
215
|
-
if (this.audioMuted !== audioMuted) {
|
216
|
-
this.speakingVolumeSamples.fill(-Infinity);
|
217
|
-
}
|
218
|
-
this.audioMuted = audioMuted;
|
219
|
-
}
|
220
|
-
if (videoMuted !== null) this.videoMuted = videoMuted;
|
221
|
-
this.emit(CallFeedEvent.MuteStateChanged, this.audioMuted, this.videoMuted);
|
222
|
-
}
|
223
|
-
|
224
|
-
/**
|
225
|
-
* Starts emitting volume_changed events where the emitter value is in decibels
|
226
|
-
* @param enabled - emit volume changes
|
227
|
-
*/
|
228
|
-
measureVolumeActivity(enabled) {
|
229
|
-
if (enabled) {
|
230
|
-
if (!this.analyser || !this.frequencyBinCount || !this.hasAudioTrack) return;
|
231
|
-
this.measuringVolumeActivity = true;
|
232
|
-
this.volumeLooper();
|
233
|
-
} else {
|
234
|
-
this.measuringVolumeActivity = false;
|
235
|
-
this.speakingVolumeSamples.fill(-Infinity);
|
236
|
-
this.emit(CallFeedEvent.VolumeChanged, -Infinity);
|
237
|
-
}
|
238
|
-
}
|
239
|
-
setSpeakingThreshold(threshold) {
|
240
|
-
this.speakingThreshold = threshold;
|
241
|
-
}
|
242
|
-
clone() {
|
243
|
-
var mediaHandler = this.client.getMediaHandler();
|
244
|
-
var stream = this.stream.clone();
|
245
|
-
logger.log("CallFeed clone() cloning stream (originalStreamId=".concat(this.stream.id, ", newStreamId").concat(stream.id, ")"));
|
246
|
-
if (this.purpose === SDPStreamMetadataPurpose.Usermedia) {
|
247
|
-
mediaHandler.userMediaStreams.push(stream);
|
248
|
-
} else {
|
249
|
-
mediaHandler.screensharingStreams.push(stream);
|
250
|
-
}
|
251
|
-
return new CallFeed({
|
252
|
-
client: this.client,
|
253
|
-
roomId: this.roomId,
|
254
|
-
userId: this.userId,
|
255
|
-
deviceId: this.deviceId,
|
256
|
-
stream,
|
257
|
-
purpose: this.purpose,
|
258
|
-
audioMuted: this.audioMuted,
|
259
|
-
videoMuted: this.videoMuted
|
260
|
-
});
|
261
|
-
}
|
262
|
-
dispose() {
|
263
|
-
var _this$stream, _this$call;
|
264
|
-
clearTimeout(this.volumeLooperTimeout);
|
265
|
-
(_this$stream = this.stream) === null || _this$stream === void 0 || _this$stream.removeEventListener("addtrack", this.onAddTrack);
|
266
|
-
(_this$call = this.call) === null || _this$call === void 0 || _this$call.removeListener(CallEvent.State, this.onCallState);
|
267
|
-
if (this.audioContext) {
|
268
|
-
this.audioContext = undefined;
|
269
|
-
this.analyser = undefined;
|
270
|
-
releaseContext();
|
271
|
-
}
|
272
|
-
this._disposed = true;
|
273
|
-
this.emit(CallFeedEvent.Disposed);
|
274
|
-
}
|
275
|
-
get disposed() {
|
276
|
-
return this._disposed;
|
277
|
-
}
|
278
|
-
set disposed(value) {
|
279
|
-
this._disposed = value;
|
280
|
-
}
|
281
|
-
getLocalVolume() {
|
282
|
-
return this.localVolume;
|
283
|
-
}
|
284
|
-
setLocalVolume(localVolume) {
|
285
|
-
this.localVolume = localVolume;
|
286
|
-
this.emit(CallFeedEvent.LocalVolumeChanged, localVolume);
|
287
|
-
}
|
288
|
-
}
|
289
|
-
//# sourceMappingURL=callFeed.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"callFeed.js","names":["SDPStreamMetadataPurpose","acquireContext","releaseContext","logger","TypedEventEmitter","CallEvent","CallState","POLLING_INTERVAL","SPEAKING_THRESHOLD","SPEAKING_SAMPLE_COUNT","CallFeedEvent","CallFeed","constructor","opts","_defineProperty","emit","NewStream","stream","state","Connected","connected","Connecting","analyser","measuringVolumeActivity","getFloatFrequencyData","frequencyBinCount","maxVolume","Infinity","volume","speakingVolumeSamples","shift","push","VolumeChanged","newSpeaking","speakingThreshold","speaking","Speaking","volumeLooperTimeout","setTimeout","volumeLooper","client","call","roomId","userId","deviceId","purpose","audioMuted","videoMuted","Array","fill","sdpMetadataStreamId","id","updateStream","hasAudioTrack","initVolumeMeasuring","addListener","State","onCallState","isLocal","_connected","ConnectedChanged","getAudioTracks","length","oldStream","newStream","wasMeasuringVolumeActivity","removeEventListener","onAddTrack","measureVolumeActivity","addEventListener","audioContext","createAnalyser","fftSize","smoothingTimeConstant","mediaStreamAudioSourceNode","createMediaStreamSource","connect","Float32Array","getMember","_callRoom$getMember","callRoom","getRoom","getUserId","undefined","getDeviceId","isAudioMuted","isVideoMuted","getVideoTracks","isSpeaking","setNewStream","setAudioVideoMuted","MuteStateChanged","enabled","setSpeakingThreshold","threshold","clone","mediaHandler","getMediaHandler","log","concat","Usermedia","userMediaStreams","screensharingStreams","dispose","_this$stream","_this$call","clearTimeout","removeListener","_disposed","Disposed","disposed","value","getLocalVolume","localVolume","setLocalVolume","LocalVolumeChanged"],"sources":["../../src/webrtc/callFeed.ts"],"sourcesContent":["/*\nCopyright 2021 Šimon Brandner <simon.bra.ag@gmail.com>\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { SDPStreamMetadataPurpose } from \"./callEventTypes.ts\";\nimport { acquireContext, releaseContext } from \"./audioContext.ts\";\nimport { MatrixClient } from \"../client.ts\";\nimport { RoomMember } from \"../models/room-member.ts\";\nimport { logger } from \"../logger.ts\";\nimport { TypedEventEmitter } from \"../models/typed-event-emitter.ts\";\nimport { CallEvent, CallState, MatrixCall } from \"./call.ts\";\n\nconst POLLING_INTERVAL = 200; // ms\nexport const SPEAKING_THRESHOLD = -60; // dB\nconst SPEAKING_SAMPLE_COUNT = 8; // samples\n\nexport interface ICallFeedOpts {\n client: MatrixClient;\n roomId?: string;\n userId: string;\n deviceId: string | undefined;\n stream: MediaStream;\n purpose: SDPStreamMetadataPurpose;\n /**\n * Whether or not the remote SDPStreamMetadata says audio is muted\n */\n audioMuted: boolean;\n /**\n * Whether or not the remote SDPStreamMetadata says video is muted\n */\n videoMuted: boolean;\n /**\n * The MatrixCall which is the source of this CallFeed\n */\n call?: MatrixCall;\n}\n\nexport enum CallFeedEvent {\n NewStream = \"new_stream\",\n MuteStateChanged = \"mute_state_changed\",\n LocalVolumeChanged = \"local_volume_changed\",\n VolumeChanged = \"volume_changed\",\n ConnectedChanged = \"connected_changed\",\n Speaking = \"speaking\",\n Disposed = \"disposed\",\n}\n\ntype EventHandlerMap = {\n [CallFeedEvent.NewStream]: (stream: MediaStream) => void;\n [CallFeedEvent.MuteStateChanged]: (audioMuted: boolean, videoMuted: boolean) => void;\n [CallFeedEvent.LocalVolumeChanged]: (localVolume: number) => void;\n [CallFeedEvent.VolumeChanged]: (volume: number) => void;\n [CallFeedEvent.ConnectedChanged]: (connected: boolean) => void;\n [CallFeedEvent.Speaking]: (speaking: boolean) => void;\n [CallFeedEvent.Disposed]: () => void;\n};\n\nexport class CallFeed extends TypedEventEmitter<CallFeedEvent, EventHandlerMap> {\n public stream: MediaStream;\n public sdpMetadataStreamId: string;\n public userId: string;\n public readonly deviceId: string | undefined;\n public purpose: SDPStreamMetadataPurpose;\n public speakingVolumeSamples: number[];\n\n private client: MatrixClient;\n private call?: MatrixCall;\n private roomId?: string;\n private audioMuted: boolean;\n private videoMuted: boolean;\n private localVolume = 1;\n private measuringVolumeActivity = false;\n private audioContext?: AudioContext;\n private analyser?: AnalyserNode;\n private frequencyBinCount?: Float32Array;\n private speakingThreshold = SPEAKING_THRESHOLD;\n private speaking = false;\n private volumeLooperTimeout?: ReturnType<typeof setTimeout>;\n private _disposed = false;\n private _connected = false;\n\n public constructor(opts: ICallFeedOpts) {\n super();\n\n this.client = opts.client;\n this.call = opts.call;\n this.roomId = opts.roomId;\n this.userId = opts.userId;\n this.deviceId = opts.deviceId;\n this.purpose = opts.purpose;\n this.audioMuted = opts.audioMuted;\n this.videoMuted = opts.videoMuted;\n this.speakingVolumeSamples = new Array(SPEAKING_SAMPLE_COUNT).fill(-Infinity);\n this.sdpMetadataStreamId = opts.stream.id;\n\n this.updateStream(null, opts.stream);\n this.stream = opts.stream; // updateStream does this, but this makes TS happier\n\n if (this.hasAudioTrack) {\n this.initVolumeMeasuring();\n }\n\n if (opts.call) {\n opts.call.addListener(CallEvent.State, this.onCallState);\n this.onCallState(opts.call.state);\n }\n }\n\n public get connected(): boolean {\n // Local feeds are always considered connected\n return this.isLocal() || this._connected;\n }\n\n private set connected(connected: boolean) {\n this._connected = connected;\n this.emit(CallFeedEvent.ConnectedChanged, this.connected);\n }\n\n public get hasAudioTrack(): boolean {\n return this.stream.getAudioTracks().length > 0;\n }\n\n private updateStream(oldStream: MediaStream | null, newStream: MediaStream): void {\n if (newStream === oldStream) return;\n\n const wasMeasuringVolumeActivity = this.measuringVolumeActivity;\n\n if (oldStream) {\n oldStream.removeEventListener(\"addtrack\", this.onAddTrack);\n this.measureVolumeActivity(false);\n }\n\n this.stream = newStream;\n newStream.addEventListener(\"addtrack\", this.onAddTrack);\n\n if (this.hasAudioTrack) {\n this.initVolumeMeasuring();\n if (wasMeasuringVolumeActivity) this.measureVolumeActivity(true);\n } else {\n this.measureVolumeActivity(false);\n }\n\n this.emit(CallFeedEvent.NewStream, this.stream);\n }\n\n private initVolumeMeasuring(): void {\n if (!this.hasAudioTrack) return;\n if (!this.audioContext) this.audioContext = acquireContext();\n\n this.analyser = this.audioContext.createAnalyser();\n this.analyser.fftSize = 512;\n this.analyser.smoothingTimeConstant = 0.1;\n\n const mediaStreamAudioSourceNode = this.audioContext.createMediaStreamSource(this.stream);\n mediaStreamAudioSourceNode.connect(this.analyser);\n\n this.frequencyBinCount = new Float32Array(this.analyser.frequencyBinCount);\n }\n\n private onAddTrack = (): void => {\n this.emit(CallFeedEvent.NewStream, this.stream);\n };\n\n private onCallState = (state: CallState): void => {\n if (state === CallState.Connected) {\n this.connected = true;\n } else if (state === CallState.Connecting) {\n this.connected = false;\n }\n };\n\n /**\n * Returns callRoom member\n * @returns member of the callRoom\n */\n public getMember(): RoomMember | null {\n const callRoom = this.client.getRoom(this.roomId);\n return callRoom?.getMember(this.userId) ?? null;\n }\n\n /**\n * Returns true if CallFeed is local, otherwise returns false\n * @returns is local?\n */\n public isLocal(): boolean {\n return (\n this.userId === this.client.getUserId() &&\n (this.deviceId === undefined || this.deviceId === this.client.getDeviceId())\n );\n }\n\n /**\n * Returns true if audio is muted or if there are no audio\n * tracks, otherwise returns false\n * @returns is audio muted?\n */\n public isAudioMuted(): boolean {\n return this.stream.getAudioTracks().length === 0 || this.audioMuted;\n }\n\n /**\n * Returns true video is muted or if there are no video\n * tracks, otherwise returns false\n * @returns is video muted?\n */\n public isVideoMuted(): boolean {\n // We assume only one video track\n return this.stream.getVideoTracks().length === 0 || this.videoMuted;\n }\n\n public isSpeaking(): boolean {\n return this.speaking;\n }\n\n /**\n * Replaces the current MediaStream with a new one.\n * The stream will be different and new stream as remote parties are\n * concerned, but this can be used for convenience locally to set up\n * volume listeners automatically on the new stream etc.\n * @param newStream - new stream with which to replace the current one\n */\n public setNewStream(newStream: MediaStream): void {\n this.updateStream(this.stream, newStream);\n }\n\n /**\n * Set one or both of feed's internal audio and video video mute state\n * Either value may be null to leave it as-is\n * @param audioMuted - is the feed's audio muted?\n * @param videoMuted - is the feed's video muted?\n */\n public setAudioVideoMuted(audioMuted: boolean | null, videoMuted: boolean | null): void {\n if (audioMuted !== null) {\n if (this.audioMuted !== audioMuted) {\n this.speakingVolumeSamples.fill(-Infinity);\n }\n this.audioMuted = audioMuted;\n }\n if (videoMuted !== null) this.videoMuted = videoMuted;\n this.emit(CallFeedEvent.MuteStateChanged, this.audioMuted, this.videoMuted);\n }\n\n /**\n * Starts emitting volume_changed events where the emitter value is in decibels\n * @param enabled - emit volume changes\n */\n public measureVolumeActivity(enabled: boolean): void {\n if (enabled) {\n if (!this.analyser || !this.frequencyBinCount || !this.hasAudioTrack) return;\n\n this.measuringVolumeActivity = true;\n this.volumeLooper();\n } else {\n this.measuringVolumeActivity = false;\n this.speakingVolumeSamples.fill(-Infinity);\n this.emit(CallFeedEvent.VolumeChanged, -Infinity);\n }\n }\n\n public setSpeakingThreshold(threshold: number): void {\n this.speakingThreshold = threshold;\n }\n\n private volumeLooper = (): void => {\n if (!this.analyser) return;\n\n if (!this.measuringVolumeActivity) return;\n\n this.analyser.getFloatFrequencyData(this.frequencyBinCount!);\n\n let maxVolume = -Infinity;\n for (const volume of this.frequencyBinCount!) {\n if (volume > maxVolume) {\n maxVolume = volume;\n }\n }\n\n this.speakingVolumeSamples.shift();\n this.speakingVolumeSamples.push(maxVolume);\n\n this.emit(CallFeedEvent.VolumeChanged, maxVolume);\n\n let newSpeaking = false;\n\n for (const volume of this.speakingVolumeSamples) {\n if (volume > this.speakingThreshold) {\n newSpeaking = true;\n break;\n }\n }\n\n if (this.speaking !== newSpeaking) {\n this.speaking = newSpeaking;\n this.emit(CallFeedEvent.Speaking, this.speaking);\n }\n\n this.volumeLooperTimeout = setTimeout(this.volumeLooper, POLLING_INTERVAL);\n };\n\n public clone(): CallFeed {\n const mediaHandler = this.client.getMediaHandler();\n const stream = this.stream.clone();\n logger.log(`CallFeed clone() cloning stream (originalStreamId=${this.stream.id}, newStreamId${stream.id})`);\n\n if (this.purpose === SDPStreamMetadataPurpose.Usermedia) {\n mediaHandler.userMediaStreams.push(stream);\n } else {\n mediaHandler.screensharingStreams.push(stream);\n }\n\n return new CallFeed({\n client: this.client,\n roomId: this.roomId,\n userId: this.userId,\n deviceId: this.deviceId,\n stream,\n purpose: this.purpose,\n audioMuted: this.audioMuted,\n videoMuted: this.videoMuted,\n });\n }\n\n public dispose(): void {\n clearTimeout(this.volumeLooperTimeout);\n this.stream?.removeEventListener(\"addtrack\", this.onAddTrack);\n this.call?.removeListener(CallEvent.State, this.onCallState);\n if (this.audioContext) {\n this.audioContext = undefined;\n this.analyser = undefined;\n releaseContext();\n }\n this._disposed = true;\n this.emit(CallFeedEvent.Disposed);\n }\n\n public get disposed(): boolean {\n return this._disposed;\n }\n\n private set disposed(value: boolean) {\n this._disposed = value;\n }\n\n public getLocalVolume(): number {\n return this.localVolume;\n }\n\n public setLocalVolume(localVolume: number): void {\n this.localVolume = localVolume;\n this.emit(CallFeedEvent.LocalVolumeChanged, localVolume);\n }\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,wBAAwB,QAAQ,qBAAqB;AAC9D,SAASC,cAAc,EAAEC,cAAc,QAAQ,mBAAmB;AAGlE,SAASC,MAAM,QAAQ,cAAc;AACrC,SAASC,iBAAiB,QAAQ,kCAAkC;AACpE,SAASC,SAAS,EAAEC,SAAS,QAAoB,WAAW;AAE5D,IAAMC,gBAAgB,GAAG,GAAG,CAAC,CAAC;AAC9B,OAAO,IAAMC,kBAAkB,GAAG,CAAC,EAAE,CAAC,CAAC;AACvC,IAAMC,qBAAqB,GAAG,CAAC,CAAC,CAAC;;AAuBjC,WAAYC,aAAa,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAoBzB,OAAO,MAAMC,QAAQ,SAASP,iBAAiB,CAAiC;EAwBrEQ,WAAWA,CAACC,IAAmB,EAAE;IACpC,KAAK,CAAC,CAAC;IAACC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,sBAZU,CAAC;IAAAA,eAAA,kCACW,KAAK;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,4BAIXN,kBAAkB;IAAAM,eAAA,mBAC3B,KAAK;IAAAA,eAAA;IA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,CAAC,UAAU,EAAE,IAAI,CAACC,UAAU,CAAC;IAC7D,CAAAsC,UAAA,OAAI,CAAChE,IAAI,cAAAgE,UAAA,eAATA,UAAA,CAAWE,cAAc,CAACtG,SAAS,CAACmD,KAAK,EAAE,IAAI,CAACC,WAAW,CAAC;IAC5D,IAAI,IAAI,CAACa,YAAY,EAAE;MACnB,IAAI,CAACA,YAAY,GAAGa,SAAS;MAC7B,IAAI,CAAC7D,QAAQ,GAAG6D,SAAS;MACzBjF,cAAc,CAAC,CAAC;IACpB;IACA,IAAI,CAAC0G,SAAS,GAAG,IAAI;IACrB,IAAI,CAAC7F,IAAI,CAACL,aAAa,CAACmG,QAAQ,CAAC;EACrC;EAEA,IAAWC,QAAQA,CAAA,EAAY;IAC3B,OAAO,IAAI,CAACF,SAAS;EACzB;EAEA,IAAYE,QAAQA,CAACC,KAAc,EAAE;IACjC,IAAI,CAACH,SAAS,GAAGG,KAAK;EAC1B;EAEOC,cAAcA,CAAA,EAAW;IAC5B,OAAO,IAAI,CAACC,WAAW;EAC3B;EAEOC,cAAcA,CAACD,WAAmB,EAAQ;IAC7C,IAAI,CAACA,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAAClG,IAAI,CAACL,aAAa,CAACyG,kBAAkB,EAAEF,WAAW,CAAC;EAC5D;AACJ","ignoreList":[]}
|
@@ -1,323 +0,0 @@
|
|
1
|
-
import { TypedEventEmitter } from "../models/typed-event-emitter.ts";
|
2
|
-
import { CallFeed } from "./callFeed.ts";
|
3
|
-
import { MatrixClient } from "../client.ts";
|
4
|
-
import { CallEvent, CallEventHandlerMap, MatrixCall } from "./call.ts";
|
5
|
-
import { RoomMember } from "../models/room-member.ts";
|
6
|
-
import { Room } from "../models/room.ts";
|
7
|
-
import { SDPStreamMetadataPurpose } from "./callEventTypes.ts";
|
8
|
-
import { IScreensharingOpts } from "./mediaHandler.ts";
|
9
|
-
import { GroupCallStats } from "./stats/groupCallStats.ts";
|
10
|
-
import { ByteSentStatsReport, CallFeedReport, ConnectionStatsReport, SummaryStatsReport } from "./stats/statsReport.ts";
|
11
|
-
import { CallMembershipData } from "../matrixrtc/CallMembership.ts";
|
12
|
-
export declare enum GroupCallIntent {
|
13
|
-
Ring = "m.ring",
|
14
|
-
Prompt = "m.prompt",
|
15
|
-
Room = "m.room"
|
16
|
-
}
|
17
|
-
export declare enum GroupCallType {
|
18
|
-
Video = "m.video",
|
19
|
-
Voice = "m.voice"
|
20
|
-
}
|
21
|
-
export declare enum GroupCallTerminationReason {
|
22
|
-
CallEnded = "call_ended"
|
23
|
-
}
|
24
|
-
export type CallsByUserAndDevice = Map<string, Map<string, MatrixCall>>;
|
25
|
-
/**
|
26
|
-
* Because event names are just strings, they do need
|
27
|
-
* to be unique over all event types of event emitter.
|
28
|
-
* Some objects could emit more then one set of events.
|
29
|
-
*/
|
30
|
-
export declare enum GroupCallEvent {
|
31
|
-
GroupCallStateChanged = "group_call_state_changed",
|
32
|
-
ActiveSpeakerChanged = "active_speaker_changed",
|
33
|
-
CallsChanged = "calls_changed",
|
34
|
-
UserMediaFeedsChanged = "user_media_feeds_changed",
|
35
|
-
ScreenshareFeedsChanged = "screenshare_feeds_changed",
|
36
|
-
LocalScreenshareStateChanged = "local_screenshare_state_changed",
|
37
|
-
LocalMuteStateChanged = "local_mute_state_changed",
|
38
|
-
ParticipantsChanged = "participants_changed",
|
39
|
-
Error = "group_call_error"
|
40
|
-
}
|
41
|
-
export type GroupCallEventHandlerMap = {
|
42
|
-
[GroupCallEvent.GroupCallStateChanged]: (newState: GroupCallState, oldState: GroupCallState) => void;
|
43
|
-
[GroupCallEvent.ActiveSpeakerChanged]: (activeSpeaker: CallFeed | undefined) => void;
|
44
|
-
[GroupCallEvent.CallsChanged]: (calls: CallsByUserAndDevice) => void;
|
45
|
-
[GroupCallEvent.UserMediaFeedsChanged]: (feeds: CallFeed[]) => void;
|
46
|
-
[GroupCallEvent.ScreenshareFeedsChanged]: (feeds: CallFeed[]) => void;
|
47
|
-
[GroupCallEvent.LocalScreenshareStateChanged]: (isScreensharing: boolean, feed?: CallFeed, sourceId?: string) => void;
|
48
|
-
[GroupCallEvent.LocalMuteStateChanged]: (audioMuted: boolean, videoMuted: boolean) => void;
|
49
|
-
[GroupCallEvent.ParticipantsChanged]: (participants: Map<RoomMember, Map<string, ParticipantState>>) => void;
|
50
|
-
/**
|
51
|
-
* Fires whenever an error occurs when call.js encounters an issue with setting up the call.
|
52
|
-
* <p>
|
53
|
-
* The error given will have a code equal to either `MatrixCall.ERR_LOCAL_OFFER_FAILED` or
|
54
|
-
* `MatrixCall.ERR_NO_USER_MEDIA`. `ERR_LOCAL_OFFER_FAILED` is emitted when the local client
|
55
|
-
* fails to create an offer. `ERR_NO_USER_MEDIA` is emitted when the user has denied access
|
56
|
-
* to their audio/video hardware.
|
57
|
-
* @param error - The error raised by MatrixCall.
|
58
|
-
* @example
|
59
|
-
* ```
|
60
|
-
* matrixCall.on("error", function(err){
|
61
|
-
* console.error(err.code, err);
|
62
|
-
* });
|
63
|
-
* ```
|
64
|
-
*/
|
65
|
-
[GroupCallEvent.Error]: (error: GroupCallError) => void;
|
66
|
-
};
|
67
|
-
export declare enum GroupCallStatsReportEvent {
|
68
|
-
ConnectionStats = "GroupCall.connection_stats",
|
69
|
-
ByteSentStats = "GroupCall.byte_sent_stats",
|
70
|
-
SummaryStats = "GroupCall.summary_stats",
|
71
|
-
CallFeedStats = "GroupCall.call_feed_stats"
|
72
|
-
}
|
73
|
-
/**
|
74
|
-
* The final report-events that get consumed by client.
|
75
|
-
*/
|
76
|
-
export type GroupCallStatsReportEventHandlerMap = {
|
77
|
-
[GroupCallStatsReportEvent.ConnectionStats]: (report: GroupCallStatsReport<ConnectionStatsReport>) => void;
|
78
|
-
[GroupCallStatsReportEvent.ByteSentStats]: (report: GroupCallStatsReport<ByteSentStatsReport>) => void;
|
79
|
-
[GroupCallStatsReportEvent.SummaryStats]: (report: GroupCallStatsReport<SummaryStatsReport>) => void;
|
80
|
-
[GroupCallStatsReportEvent.CallFeedStats]: (report: GroupCallStatsReport<CallFeedReport>) => void;
|
81
|
-
};
|
82
|
-
export declare enum GroupCallErrorCode {
|
83
|
-
NoUserMedia = "no_user_media",
|
84
|
-
UnknownDevice = "unknown_device",
|
85
|
-
PlaceCallFailed = "place_call_failed"
|
86
|
-
}
|
87
|
-
export interface GroupCallStatsReport<T extends ConnectionStatsReport | ByteSentStatsReport | SummaryStatsReport | CallFeedReport> {
|
88
|
-
report: T;
|
89
|
-
}
|
90
|
-
export declare class GroupCallError extends Error {
|
91
|
-
code: string;
|
92
|
-
constructor(code: GroupCallErrorCode, msg: string, err?: Error);
|
93
|
-
}
|
94
|
-
export declare class GroupCallUnknownDeviceError extends GroupCallError {
|
95
|
-
userId: string;
|
96
|
-
constructor(userId: string);
|
97
|
-
}
|
98
|
-
export declare class OtherUserSpeakingError extends Error {
|
99
|
-
constructor();
|
100
|
-
}
|
101
|
-
export interface IGroupCallDataChannelOptions {
|
102
|
-
ordered: boolean;
|
103
|
-
maxPacketLifeTime: number;
|
104
|
-
maxRetransmits: number;
|
105
|
-
protocol: string;
|
106
|
-
}
|
107
|
-
export interface IGroupCallRoomState {
|
108
|
-
"m.intent": GroupCallIntent;
|
109
|
-
"m.type": GroupCallType;
|
110
|
-
"m.terminated"?: GroupCallTerminationReason;
|
111
|
-
"io.element.ptt"?: boolean;
|
112
|
-
"dataChannelsEnabled"?: boolean;
|
113
|
-
"dataChannelOptions"?: IGroupCallDataChannelOptions;
|
114
|
-
"io.element.livekit_service_url"?: string;
|
115
|
-
}
|
116
|
-
export interface IGroupCallRoomMemberFeed {
|
117
|
-
purpose: SDPStreamMetadataPurpose;
|
118
|
-
}
|
119
|
-
export interface IGroupCallRoomMemberDevice {
|
120
|
-
device_id: string;
|
121
|
-
session_id: string;
|
122
|
-
expires_ts: number;
|
123
|
-
feeds: IGroupCallRoomMemberFeed[];
|
124
|
-
}
|
125
|
-
export interface IGroupCallRoomMemberCallState {
|
126
|
-
"m.call_id": string;
|
127
|
-
"m.foci"?: string[];
|
128
|
-
"m.devices": IGroupCallRoomMemberDevice[];
|
129
|
-
}
|
130
|
-
export interface IGroupCallRoomMemberState {
|
131
|
-
"m.calls": IGroupCallRoomMemberCallState[];
|
132
|
-
}
|
133
|
-
export interface ExperimentalGroupCallRoomMemberState {
|
134
|
-
memberships: CallMembershipData[];
|
135
|
-
}
|
136
|
-
export declare enum GroupCallState {
|
137
|
-
LocalCallFeedUninitialized = "local_call_feed_uninitialized",
|
138
|
-
InitializingLocalCallFeed = "initializing_local_call_feed",
|
139
|
-
LocalCallFeedInitialized = "local_call_feed_initialized",
|
140
|
-
Entered = "entered",
|
141
|
-
Ended = "ended"
|
142
|
-
}
|
143
|
-
export interface ParticipantState {
|
144
|
-
sessionId: string;
|
145
|
-
screensharing: boolean;
|
146
|
-
}
|
147
|
-
export declare class GroupCall extends TypedEventEmitter<GroupCallEvent | CallEvent | GroupCallStatsReportEvent, GroupCallEventHandlerMap & CallEventHandlerMap & GroupCallStatsReportEventHandlerMap> {
|
148
|
-
private client;
|
149
|
-
room: Room;
|
150
|
-
type: GroupCallType;
|
151
|
-
isPtt: boolean;
|
152
|
-
intent: GroupCallIntent;
|
153
|
-
private dataChannelsEnabled?;
|
154
|
-
private dataChannelOptions?;
|
155
|
-
private useLivekit;
|
156
|
-
activeSpeakerInterval: number;
|
157
|
-
retryCallInterval: number;
|
158
|
-
participantTimeout: number;
|
159
|
-
pttMaxTransmitTime: number;
|
160
|
-
activeSpeaker?: CallFeed;
|
161
|
-
localCallFeed?: CallFeed;
|
162
|
-
localScreenshareFeed?: CallFeed;
|
163
|
-
localDesktopCapturerSourceId?: string;
|
164
|
-
readonly userMediaFeeds: CallFeed[];
|
165
|
-
readonly screenshareFeeds: CallFeed[];
|
166
|
-
groupCallId: string;
|
167
|
-
readonly allowCallWithoutVideoAndAudio: boolean;
|
168
|
-
private readonly calls;
|
169
|
-
private callHandlers;
|
170
|
-
private activeSpeakerLoopInterval?;
|
171
|
-
private retryCallLoopInterval?;
|
172
|
-
private retryCallCounts;
|
173
|
-
private reEmitter;
|
174
|
-
private transmitTimer;
|
175
|
-
private participantsExpirationTimer;
|
176
|
-
private resendMemberStateTimer;
|
177
|
-
private initWithAudioMuted;
|
178
|
-
private initWithVideoMuted;
|
179
|
-
private initCallFeedPromise?;
|
180
|
-
private _livekitServiceURL?;
|
181
|
-
private stats;
|
182
|
-
/**
|
183
|
-
* Configure default webrtc stats collection interval in ms
|
184
|
-
* Disable collecting webrtc stats by setting interval to 0
|
185
|
-
*/
|
186
|
-
private statsCollectIntervalTime;
|
187
|
-
constructor(client: MatrixClient, room: Room, type: GroupCallType, isPtt: boolean, intent: GroupCallIntent, groupCallId?: string, dataChannelsEnabled?: boolean | undefined, dataChannelOptions?: IGroupCallDataChannelOptions | undefined, isCallWithoutVideoAndAudio?: boolean, useLivekit?: boolean, livekitServiceURL?: string);
|
188
|
-
private onConnectionStats;
|
189
|
-
private onByteSentStats;
|
190
|
-
private onSummaryStats;
|
191
|
-
private onCallFeedReport;
|
192
|
-
create(): Promise<GroupCall>;
|
193
|
-
private sendCallStateEvent;
|
194
|
-
get livekitServiceURL(): string | undefined;
|
195
|
-
updateLivekitServiceURL(newURL: string): Promise<void>;
|
196
|
-
private _state;
|
197
|
-
/**
|
198
|
-
* The group call's state.
|
199
|
-
*/
|
200
|
-
get state(): GroupCallState;
|
201
|
-
private set state(value);
|
202
|
-
private _participants;
|
203
|
-
/**
|
204
|
-
* The current participants in the call, as a map from members to device IDs
|
205
|
-
* to participant info.
|
206
|
-
*/
|
207
|
-
get participants(): Map<RoomMember, Map<string, ParticipantState>>;
|
208
|
-
private set participants(value);
|
209
|
-
private _creationTs;
|
210
|
-
/**
|
211
|
-
* The timestamp at which the call was created, or null if it has not yet
|
212
|
-
* been created.
|
213
|
-
*/
|
214
|
-
get creationTs(): number | null;
|
215
|
-
private set creationTs(value);
|
216
|
-
private _enteredViaAnotherSession;
|
217
|
-
/**
|
218
|
-
* Whether the local device has entered this call via another session, such
|
219
|
-
* as a widget.
|
220
|
-
*/
|
221
|
-
get enteredViaAnotherSession(): boolean;
|
222
|
-
set enteredViaAnotherSession(value: boolean);
|
223
|
-
/**
|
224
|
-
* Executes the given callback on all calls in this group call.
|
225
|
-
* @param f - The callback.
|
226
|
-
*/
|
227
|
-
forEachCall(f: (call: MatrixCall) => void): void;
|
228
|
-
getLocalFeeds(): CallFeed[];
|
229
|
-
hasLocalParticipant(): boolean;
|
230
|
-
/**
|
231
|
-
* Determines whether the given call is one that we were expecting to exist
|
232
|
-
* given our knowledge of who is participating in the group call.
|
233
|
-
*/
|
234
|
-
private callExpected;
|
235
|
-
initLocalCallFeed(): Promise<void>;
|
236
|
-
private initLocalCallFeedInternal;
|
237
|
-
updateLocalUsermediaStream(stream: MediaStream): Promise<void>;
|
238
|
-
enter(): Promise<void>;
|
239
|
-
private dispose;
|
240
|
-
leave(): void;
|
241
|
-
terminate(emitStateEvent?: boolean): Promise<void>;
|
242
|
-
isLocalVideoMuted(): boolean;
|
243
|
-
isMicrophoneMuted(): boolean;
|
244
|
-
/**
|
245
|
-
* Sets the mute state of the local participants's microphone.
|
246
|
-
* @param muted - Whether to mute the microphone
|
247
|
-
* @returns Whether muting/unmuting was successful
|
248
|
-
*/
|
249
|
-
setMicrophoneMuted(muted: boolean): Promise<boolean>;
|
250
|
-
/**
|
251
|
-
* If we allow entering a call without a camera and without video, it can happen that the access rights to the
|
252
|
-
* devices have not yet been queried. If a stream does not yet have an audio track, we assume that the rights have
|
253
|
-
* not yet been checked.
|
254
|
-
*
|
255
|
-
* `this.client.getMediaHandler().getUserMediaStream` clones the current stream, so it only wanted to be called when
|
256
|
-
* not Audio Track exists.
|
257
|
-
* As such, this is a compromise, because, the access rights should always be queried before the call.
|
258
|
-
*/
|
259
|
-
private checkAudioPermissionIfNecessary;
|
260
|
-
/**
|
261
|
-
* Sets the mute state of the local participants's video.
|
262
|
-
* @param muted - Whether to mute the video
|
263
|
-
* @returns Whether muting/unmuting was successful
|
264
|
-
*/
|
265
|
-
setLocalVideoMuted(muted: boolean): Promise<boolean>;
|
266
|
-
setScreensharingEnabled(enabled: boolean, opts?: IScreensharingOpts): Promise<boolean>;
|
267
|
-
isScreensharing(): boolean;
|
268
|
-
private onIncomingCall;
|
269
|
-
/**
|
270
|
-
* Determines whether a given participant expects us to call them (versus
|
271
|
-
* them calling us).
|
272
|
-
* @param userId - The participant's user ID.
|
273
|
-
* @param deviceId - The participant's device ID.
|
274
|
-
* @returns Whether we need to place an outgoing call to the participant.
|
275
|
-
*/
|
276
|
-
private wantsOutgoingCall;
|
277
|
-
/**
|
278
|
-
* Places calls to all participants that we're responsible for calling.
|
279
|
-
*/
|
280
|
-
private placeOutgoingCalls;
|
281
|
-
private getMemberStateEvents;
|
282
|
-
private onRetryCallLoop;
|
283
|
-
private initCall;
|
284
|
-
private disposeCall;
|
285
|
-
private onCallFeedsChanged;
|
286
|
-
private onCallStateChanged;
|
287
|
-
private onCallHangup;
|
288
|
-
private onCallReplaced;
|
289
|
-
getUserMediaFeed(userId: string, deviceId: string): CallFeed | undefined;
|
290
|
-
private addUserMediaFeed;
|
291
|
-
private replaceUserMediaFeed;
|
292
|
-
private removeUserMediaFeed;
|
293
|
-
private onActiveSpeakerLoop;
|
294
|
-
getScreenshareFeed(userId: string, deviceId: string): CallFeed | undefined;
|
295
|
-
private addScreenshareFeed;
|
296
|
-
private replaceScreenshareFeed;
|
297
|
-
private removeScreenshareFeed;
|
298
|
-
/**
|
299
|
-
* Recalculates and updates the participant map to match the room state.
|
300
|
-
*/
|
301
|
-
private updateParticipants;
|
302
|
-
/**
|
303
|
-
* Updates the local user's member state with the devices returned by the given function.
|
304
|
-
* @param fn - A function from the current devices to the new devices. If it
|
305
|
-
* returns null, the update will be skipped.
|
306
|
-
* @param keepAlive - Whether the request should outlive the window.
|
307
|
-
*/
|
308
|
-
private updateDevices;
|
309
|
-
private addDeviceToMemberState;
|
310
|
-
private updateMemberState;
|
311
|
-
/**
|
312
|
-
* Cleans up our member state by filtering out logged out devices, inactive
|
313
|
-
* devices, and our own device (if we know we haven't entered).
|
314
|
-
*/
|
315
|
-
cleanMemberState(): Promise<void>;
|
316
|
-
private onRoomState;
|
317
|
-
private onParticipantsChanged;
|
318
|
-
private onStateChanged;
|
319
|
-
private onLocalFeedsChanged;
|
320
|
-
getGroupCallStats(): GroupCallStats;
|
321
|
-
setGroupCallStatsInterval(interval: number): void;
|
322
|
-
}
|
323
|
-
//# sourceMappingURL=groupCall.d.ts.map
|