fix: play ringtone for incoming calls before trying to getUserMedia
This commit is contained in:
		
							parent
							
								
									dd7cf5c1bf
								
							
						
					
					
						commit
						bd352b60a6
					
				|  | @ -229,6 +229,17 @@ class VoIP { | ||||||
|       content['offer']['type'], |       content['offer']['type'], | ||||||
|     ); |     ); | ||||||
| 
 | 
 | ||||||
|  |     /// play ringtone. We decided to play the ringtone before adding the call to | ||||||
|  |     /// the incoming call stream because getUserMedia from initWithInvite fails | ||||||
|  |     /// on firefox unless the tab is in focus. We should atleast be able to notify | ||||||
|  |     /// the user about an incoming call | ||||||
|  |     /// | ||||||
|  |     /// Autoplay on firefox still needs interaction, without which all notifications | ||||||
|  |     /// could be blocked. | ||||||
|  |     if (confId == null) { | ||||||
|  |       delegate.playRingtone(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     await newCall.initWithInvite( |     await newCall.initWithInvite( | ||||||
|         callType, offer, sdpStreamMetadata, lifetime, confId != null); |         callType, offer, sdpStreamMetadata, lifetime, confId != null); | ||||||
| 
 | 
 | ||||||
|  | @ -247,10 +258,6 @@ class VoIP { | ||||||
| 
 | 
 | ||||||
|       ///TODO: notify the callkeep that the call is incoming. |       ///TODO: notify the callkeep that the call is incoming. | ||||||
|     } |     } | ||||||
|     // Play ringtone |  | ||||||
|     if (confId == null) { |  | ||||||
|       delegate.playRingtone(); |  | ||||||
|     } |  | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   Future<void> onCallAnswer( |   Future<void> onCallAnswer( | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue