Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
266 views
in Technique[技术] by (71.8m points)

tokbox - Receiving mediaStopped twice with identical track when OpenTok publisher blocks device access

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. enter image description here

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...