triniwiz / nativescript-webrtc

Apache License 2.0
42 stars 25 forks source link

Request: didCaptureVideoFrame delegate method #26

Open codingcronus opened 5 years ago

codingcronus commented 5 years ago

I have created an VOIP app using Nativescript WebRTC. The receiver can receive calls while the app is not running via VOIP push notifications. Such a push notification will present a local notification (I really should implement CallKit...) to the user and if the user accepts the call, the app is launched and the call is initiated. When the app is started via a local notification interaction and from there instantly tries to access the local video feed, I sometimes get in a siuation where it thinks the local video is streaming, but it is not. If I toggle the front/back camera in the app, the video starts to stream.

Because of this I need somehow to conclude if the local video is streaming or not. I think the RTCVideoCapturerDelegate in the Google WebRTC framework that FancyWebRTC and hence Nativescript WebRTC is based upon, could be a feasible way to go. The delegate has a method: capturer:didCaptureVideoFrame which we could use to tell whether or not the app is streaming local video.