feross / simple-peer

📡 Simple WebRTC video, voice, and data channels
MIT License
7.43k stars 974 forks source link

`replaceTrack` should return a Promise #596

Open ArmorDarks opened 4 years ago

ArmorDarks commented 4 years ago

According to the specs, sender.replaceTrack should return a Promise which will resolve when track replacement has finished.

SimplePeer, on the contrary, returns void which makes it harder to await track replacement completion.

nazar-pc commented 4 years ago

This one is similar to #593, most APIs should actually return values and be async to allow for advanced use cases.