streamCreated
event is only triggered in 2 situations:
- When first connected to a Session, once for every Stream that was already being published to the Session. This is immediately after triggering the local
connectionCreated
event. - With the user alreay being connected to the Session, once for every new Stream published to the Session.
If your user has not configured a listener for the streamCreated
event when point 2. takes place, it will miss the event. And registering it later does not mean previous streamCreated
events will be triggered: they are lost. So yes, the best way to handle this is registering the streamCreated listener even before connecting to the Session, and store and manage the events as you wish during the call.