apivideo / api.video-flutter-live-stream

Flutter RTMP live stream client. Made with ♥ by api.video
MIT License
70 stars 41 forks source link

Connection lost during streaming #25

Closed niranjank151 closed 1 year ago

niranjank151 commented 1 year ago

Hi,

May I know how to reconnect the existing streaming(streamKey already present) if the connection lost due to interruption?

ThibaultBee commented 1 year ago

Hi,

Just call startStreaming again.

niranjank151 commented 1 year ago

If i call startStreaming then getting exception (PlatformException(failed_to_start_stream, Failed to connect, null, null)), Connection failed: Failed to connect.

ThibaultBee commented 1 year ago

Does you server support that? Maybe it just rejects the connection. Also, please, adds info on phone and add logs.

niranjank151 commented 1 year ago

We are using the Facebook RTMPS server for streaming. when we have two calls to startStreaming then it continue streaming however for first time we get the connection failed error.

E/ActivityThread(15461): Failed to find provider info for com.oplus.statistics.provider
E/OplusStatistics--(15461): IllegalArgumentException:java.lang.IllegalArgumentException: Unknown URL content://com.oplus.statistics.provider/track_event
PlatformException(failed_to_start_stream, Failed to connect, null, null)
I/flutter (15461): #0      LiveStreamController.startStreaming (package:apivideo_live_stream/apivideo_live_stream.dart:86:7)
I/flutter (15461): <asynchronous suspension>
I/flutter (15461): #1      _StreamVideoToFBState.createProductOnLive (package:package_name/Screen/StreamingVideo/StreamVideo.dart:726:11)
I/flutter (15461): <asynchronous suspension>
I/flutter (15461): ----------------------------------------------------
I/flutter (15461): Connection failed: Failed to connect
W/System  (15461): A resource failed to call Surface.release. 
W/System  (15461): A resource failed to call Surface.release. 
W/System  (15461): A resource failed to call Surface.release. 
D/BufferQueueConsumer(15461): [SurfaceTexture-0-15461-3](id:3c6500000007,api:0,p:-1,c:15461) disconnect
D/TrafficStats(15461): tagSocket(137) with statsTag=0xffffffff, statsUid=-1
ThibaultBee commented 1 year ago

As you try 2 connections with the same configuration, the first failed but the second connection succeeds it seems to be a server error and there are nothing we can do here. Please, check with your server.