Line data Source code
1 : import 'package:matrix/matrix.dart'; 2 : 3 : /// https://github.com/matrix-org/matrix-doc/pull/2746 4 : /// version 1 5 : const String voipProtoVersion = '1'; 6 : 7 : class CallTimeouts { 8 : /// The default life time for call events, in millisecond. 9 : static const defaultCallEventLifetime = Duration(seconds: 10); 10 : 11 : /// The length of time a call can be ringing for. 12 : static const callInviteLifetime = Duration(seconds: 60); 13 : 14 : /// The delay for ice gathering. 15 : static const iceGatheringDelay = Duration(milliseconds: 200); 16 : 17 : /// Delay before createOffer. 18 : static const delayBeforeOffer = Duration(milliseconds: 100); 19 : 20 : /// How often to update the expiresTs 21 : static const updateExpireTsTimerDuration = Duration(minutes: 2); 22 : 23 : /// the expiresTs bump 24 : static const expireTsBumpDuration = Duration(minutes: 6); 25 : 26 : /// Update the active speaker value 27 : static const activeSpeakerInterval = Duration(seconds: 5); 28 : 29 : // source: element call? 30 : /// A delay after a member leaves before we create and publish a new key, because people 31 : /// tend to leave calls at the same time 32 : static const makeKeyDelay = Duration(seconds: 4); 33 : 34 : /// The delay between creating and sending a new key and starting to encrypt with it. This gives others 35 : /// a chance to receive the new key to minimise the chance they don't get media they can't decrypt. 36 : /// The total time between a member leaving and the call switching to new keys is therefore 37 : /// makeKeyDelay + useKeyDelay 38 : static const useKeyDelay = Duration(seconds: 4); 39 : } 40 : 41 : class CallConstants { 42 99 : static final callEventsRegxp = RegExp( 43 : r'm.call.|org.matrix.call.|org.matrix.msc3401.call.|com.famedly.call.', 44 : ); 45 : 46 : static const callEndedEventTypes = { 47 : EventTypes.CallAnswer, 48 : EventTypes.CallHangup, 49 : EventTypes.CallReject, 50 : EventTypes.CallReplaces, 51 : }; 52 : static const omitWhenCallEndedTypes = { 53 : EventTypes.CallInvite, 54 : EventTypes.CallCandidates, 55 : EventTypes.CallNegotiate, 56 : EventTypes.CallSDPStreamMetadataChanged, 57 : EventTypes.CallSDPStreamMetadataChangedPrefix, 58 : }; 59 : 60 : static const updateExpireTsTimerDuration = Duration(seconds: 15); 61 : static const expireTsBumpDuration = Duration(seconds: 45); 62 : static const activeSpeakerInterval = Duration(seconds: 5); 63 : }