You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently out 'stopped' event handler is responsible for unpublishing the track and performing other cleanup. An example of where this occurs is when a media device disconnects, causing the underlying MediaStreamTrack to end. However, we don't want to run such cleanup when a track is restarted.
Does this sound like a possible enhancement, or are there some alternative solutions I can implement?
The text was updated successfully, but these errors were encountered:
Thank you reporting this issue. Yeah, it's hard to differentiate between 'stopped' caused by restart v/s other things causing the track to end. In your case - is restart initiated by you or the SDK in response to track being ended (SDK does call restart internally for some iOS safari use cases)
if restart is initiated by your application, you can wait for the promise returned by restart to resolve before acting on any stop event.
For the restart that is initiated by SDK - The only workaround I see is to delay your stopped handling. if you get a 'stopped` event wait for a couple second , and act on it only if it stayed in stopped state.
That said, I think we will consider adding a parameter to stopped event to distinguish between these cases. I have added a ticket to track this improvement: VIDEO-7421
The main case in our application is the internal SDK restart for iOS safari backgrounding/foregrounding, as you mentioned. However, we do plan on replacing old unpublish/publish workflows in our application with the new restart functionality.
I am keen for an enhancement such as the extra parameter you proposed. Cheers for creating a ticket and providing some workarounds in the mean time.
Hello,
I'm seeking the ability to determine if the 'stopped' event on track was triggered by a restart (https://sdk.twilio.com/js/video/releases/2.18.0/docs/LocalAudioTrack.html#restart).
Currently out 'stopped' event handler is responsible for unpublishing the track and performing other cleanup. An example of where this occurs is when a media device disconnects, causing the underlying MediaStreamTrack to end. However, we don't want to run such cleanup when a track is restarted.
Does this sound like a possible enhancement, or are there some alternative solutions I can implement?
The text was updated successfully, but these errors were encountered: