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 93 : static final callEventsRegxp = RegExp( 43 : r'm.call.|org.matrix.call.|org.matrix.msc3401.call.|com.famedly.call.'); 44 : 45 : static const callEndedEventTypes = { 46 : EventTypes.CallAnswer, 47 : EventTypes.CallHangup, 48 : EventTypes.CallReject, 49 : EventTypes.CallReplaces, 50 : }; 51 : static const omitWhenCallEndedTypes = { 52 : EventTypes.CallInvite, 53 : EventTypes.CallCandidates, 54 : EventTypes.CallNegotiate, 55 : EventTypes.CallSDPStreamMetadataChanged, 56 : EventTypes.CallSDPStreamMetadataChangedPrefix, 57 : }; 58 : 59 : static const updateExpireTsTimerDuration = Duration(seconds: 15); 60 : static const expireTsBumpDuration = Duration(seconds: 45); 61 : static const activeSpeakerInterval = Duration(seconds: 5); 62 : }