WebRTC-Android-SDK
WebRTC-Android-SDK copied to clipboard
Fix Reconnect Crash By Removing Waiting For WebSocket Connection
Call init by default on webrtcClieint initialization
Call init inside publish/play only if sdk is closed previously.(stop called)
Remove waiting for WS connection with thread.sleep, move to callback style
https://github.com/ant-media/Ant-Media-Server/issues/6100
Initially, I planned to eliminate the initialization process entirely from the publish and play functions. However, upon calling the stop() function, all resources are disposed of. Consequently, calling the initialization process again becomes necessary. Samples refactored to only allow calling publish/play if websocket is connected.
This pull request breaks backward compatibility. However, I believe it's essential and worthwhile because we need to eliminate the need for waiting on WebSocket connections using thread.sleep. It represents poor design and leads to ANRs and crashes, much like the reconnect crash.
do not review yet this actually didnt solve the bug. the root cause is harder than i thought.
more changes added. segmentation fault fixed. i performed some comprehensive testing on my side and it worked fine. its reviewable now. @burak-58
This PR is refactored and broken down to smaller PRs.