@@ -84,7 +84,7 @@ class Logger {
8484
8585/// The web implementation of [TwilioVoicePlatform] .
8686class TwilioVoiceWeb extends MethodChannelTwilioVoice {
87-
87+
8888 static const _codecs = ["opus" , "pcmu" ];
8989 static const _closeProtection = true ;
9090 final Map <String , String > _soundMap = {};
@@ -171,8 +171,10 @@ class TwilioVoiceWeb extends MethodChannelTwilioVoice {
171171 @override
172172 Call get call => _call;
173173
174+ static final TwilioVoicePlatform _instance = TwilioVoiceWeb ();
175+
174176 static void registerWith (Registrar registrar) {
175- TwilioVoicePlatform .instance = TwilioVoiceWeb () ;
177+ TwilioVoicePlatform .instance = _instance ;
176178 }
177179
178180 Stream <CallEvent >? _callEventsListener;
@@ -373,16 +375,16 @@ class TwilioVoiceWeb extends MethodChannelTwilioVoice {
373375 device! .updateToken (accessToken);
374376 } else {
375377 /// opus set as primary code
376- /// https://www.twilio.com/blog/client-javascript-sdk-1-7-ga
377- List <String > codecs = ["opus" , "pcmu" ];
378- twilio_js.DeviceOptions options = twilio_js.DeviceOptions (
379- codecPreferences: codecs,
380- closeProtection: true ,
381- );
382-
383- /// create new Twilio device
384- device = twilio_js.Device (accessToken, options);
385- _call.device = device;
378+ /// https://www.twilio.com/blog/client-javascript-sdk-1-7-ga
379+ List <String > codecs = ["opus" , "pcmu" ];
380+ twilio_js.DeviceOptions options = twilio_js.DeviceOptions (
381+ codecPreferences: codecs,
382+ closeProtection: true ,
383+ );
384+
385+ /// create new Twilio device
386+ device = twilio_js.Device (accessToken, options);
387+ _call.device = device;
386388 _attachDeviceListeners (device! );
387389
388390 // Register device to accept notifications
0 commit comments