We have a web application where the webcam and microphone are published in a OpenTok session.
Of course the user has to allow access to the devices.
We subscribe to some events of the publisher, one of which is the 'mediaStopped' event. Now when the user after some time blocks access to the webcam and mic, we receive this event. However, in Chrome 88, we receive this event twice in a row.
The 'track' provided in this event is identical, so there is no way to differentiate between the two events. The 'kind' property is always on 'video', so no way to differentiate between audio or video device.
How can we solve this issue, so that we only show this event once to the user? Should we ignore the second event if received within a certain timeframe? I'm not very fond of the idea to 'swallow' events.
question from:
https://stackoverflow.com/questions/65843337/receiving-mediastopped-twice-with-identical-track-when-opentok-publisher-blocks 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…