Wowza SDK iOS : Can't reconnect ULL Stream when internet lost -> Wowza cloud ULL

Hello,

I test my iOS app with Wowza SDK.

I see something wrong… :

When I switch wifi to 4G (cellular phone), the SDK trigger an error with the function : - (void) onWOWZError:(WOWZStatus *) goCoderStatus

Do you know how i can reconnect the stream ? i try to do this : [self.goCoderstartStreaming:self];

But It doesn’t work…

Thank you for your help ! :slight_smile:

The output of xcode :

2019-01-14 14:12:40.604738+0100 VisiteMonAppart[9973:4706852] Broadcast status: Broadcast initialization

2019-01-14 14:12:40.875907+0100 VisiteMonAppart[9973:4706852] WowzaGoCoderSDK: Default socket buffer size: 131072 with err = 0

2019-01-14 14:12:40.876089+0100 VisiteMonAppart[9973:4706852] WowzaGoCoderSDK: Updated socket buffer size: 1024000 with err = 0

2019-01-14 14:12:40.925834+0100 VisiteMonAppart[9973:4706852] WowzaGoCoderSDK: Connected

2019-01-14 14:12:40.926187+0100 VisiteMonAppart[9973:4706852] WowzaGoCoderSDK: Preparing broadcaster with width = 640, height = 720, frameRate = 24, video bitRate = 348160, audio sample rate = 48000, audio bitrate = 128000

2019-01-14 14:12:40.993756+0100 VisiteMonAppart[9973:4706852] Session state changed from HANDSHAKE_SERVER0_SENT to CONNECT_SENT

2019-01-14 14:12:40.993858+0100 VisiteMonAppart[9973:4706852] Sending message with the following properties:

2019-01-14 14:12:40.993894+0100 VisiteMonAppart[9973:4706852] [00]: “connect”,

[01]: 1,

[02]: {“app”: “live”,

"flashVer": “Wowza GoCoder SDK/1.0”,

"swfUrl": “WowzaTransportSDK”,

"tcUrl": “wowz://origin.cdn.wowza.com:1935/live”,

"fpad": false,

"audioCodecs": 3191,

"videoCodecs": 252,

"pageUrl": “”}

2019-01-14 14:12:41.061734+0100 VisiteMonAppart[9973:4706852] message[setbuffersize:unknown]: size:6 cmdId:0

2019-01-14 14:12:41.061790+0100 VisiteMonAppart[9973:4706852] Function call SUCCESS result received with the following properties:

2019-01-14 14:12:41.061821+0100 VisiteMonAppart[9973:4706852] [00]: “_result”,

[01]: 1,

[02]: {“fmsVer”: “FMS/3,5,7,7009”,

"capabilities": 31,

"mode": 1},

[03]: {“level”: “status”,

"code": “NetConnection.Connect.Success”,

"description": “Connection succeeded.”,

"data": {“version”: “3,5,7,7009”},

"clientid": 4.18055e+08,

"objectEncoding": 0}

2019-01-14 14:12:41.061851+0100 VisiteMonAppart[9973:4706852] Invoking the function response handler for function id 1

2019-01-14 14:12:41.061865+0100 VisiteMonAppart[9973:4706852] pushPublishMessageReceiveHandleResultConnect: code:NetConnection.Connect.Success

2019-01-14 14:12:41.061877+0100 VisiteMonAppart[9973:4706852] Session state changed from CONNECT_SENT to CONNECTED

2019-01-14 14:12:41.061890+0100 VisiteMonAppart[9973:4706852] Sending message with the following properties:

2019-01-14 14:12:41.061903+0100 VisiteMonAppart[9973:4706852] [00]: “releaseStream”,

[01]: 0,

[02]: (NULL),

[03]: "0I0p2RWhBVHsS4MkICM9xl5QN0Cu5729"

2019-01-14 14:12:41.061965+0100 VisiteMonAppart[9973:4706852] Sending message with the following properties:

2019-01-14 14:12:41.061978+0100 VisiteMonAppart[9973:4706852] [00]: “createStream”,

[01]: 2,

[02]: (NULL)

2019-01-14 14:12:41.113505+0100 VisiteMonAppart[9973:4706852] Function call SUCCESS result received with the following properties:

2019-01-14 14:12:41.113548+0100 VisiteMonAppart[9973:4706852] [00]: “_result”,

[01]: 2,

[02]: (NULL),

[03]: 1

2019-01-14 14:12:41.113562+0100 VisiteMonAppart[9973:4706852] Invoking the function response handler for function id 2

2019-01-14 14:12:41.113574+0100 VisiteMonAppart[9973:4706852] pushPublishMessageReceiveHandleResultCreateStream: isError: 0

2019-01-14 14:12:41.113603+0100 VisiteMonAppart[9973:4706852] Sending message with the following properties:

2019-01-14 14:12:41.113618+0100 VisiteMonAppart[9973:4706852] [00]: “publish”,

[01]: 3,

[02]: (NULL),

[03]: "0I0p2RWhBVHsS4MkICM9xl5QN0Cu5729"

2019-01-14 14:12:41.821696+0100 VisiteMonAppart[9973:4706852] message[setbuffersize:unknown]: size:6 cmdId:0

It seems that when i wait 10 seconds before restart the stream, it works…

Can you tell me why ?

Is this solution is the best way ? :

My code :

- (void) onWOWZError:(WOWZStatus *) goCoderStatus {
// If an error is reported by the GoCoder SDK, display an alert
// that contains the error details using the U/I thread
	dispatch_async(dispatch_get_main_queue(), ^{
		UIAlertView *alertDialog =
		[[UIAlertViewalloc] initWithTitle:@"Streaming Error"
			message:goCoderStatus.description
			delegate:nil
			cancelButtonTitle:@"OK"
			otherButtonTitles:nil];
		[alertDialog show];

		if([networkConnectionWhileRecordingisEqualToString:@""])
		{
			_lSearchNetwork.text = @"Connexion dans 10 secondes";
			[self performSelector:@selector(startStreaming) withObject:@"" afterDelay:10.0];
		}
	});
}

Let me check into this for you @Jeremie PERERA…

Hello @Rose Power-Wowza Community Manager.

I always have this problem when my iOS lost the internet connection.

I am using AFNetworkReachabilityManager for the dection of the internet lost.

Then when internet is up, I detect id goCoder has no error, and i try to reconnect. sometimes, i get this error :

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; color: #000000; background-color: #ffffff}

SendDelegateMessage(NSInvocation *): delegate (webView:identifierForInitialRequest:fromDataSource:) failed to return after waiting 10.000000 seconds. main run loop mode: kCFRunLoopDefaultMode

I am using the broadcast function with the MP4 writing.

So i can’t today handle the internet lost, this crash my app… do you have any idea ?

Hello @Rose Power-Wowza Community Manager.

I always have this problem when my iOS lost the internet connection.

I am using AFNetworkReachabilityManager for the dection of the internet lost.

Then when internet is up, I detect id goCoder has no error, and i try to reconnect. sometimes, i get this error :

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Menlo; color: #000000; background-color: #ffffff}

SendDelegateMessage(NSInvocation *): delegate (webView:identifierForInitialRequest:fromDataSource:) failed to return after waiting 10.000000 seconds. main run loop mode: kCFRunLoopDefaultMode

I am using the broadcast function with the MP4 writing.

So i can’t today handle the internet lost, this crash my app… do you have any idea ?

Ok I find a way :

Use the wowza status function to trigger a loss of internet connection.

And update the Wowza iOS SDK which resolve the problem that you can reconnect after a deconnection