Receiving error in 2.6.23 when attempting to publish stream

Just66

New Member
2021-02-18 15:00:32.370716+0200 Flustr[7285:2900451] Selected fps: 30


2021-02-18 15:00:32.390779+0200 Flustr[7285:2900825] peerConnectionShouldNegotiate


2021-02-18 15:00:32.390944+0200 Flustr[7285:2900729] -[RTCAudioSessionConfiguration setOnlyPlayback:]: unrecognized selector sent to instance 0x2824a7a00


2021-02-18 15:00:32.395947+0200 Flustr[7285:2900729] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[RTCAudioSessionConfiguration setOnlyPlayback:]: unrecognized selector sent to instance 0x2824a7a00'


*** First throw call stack:


(0x1a501586c 0x1ba030c50 0x1a4f1c95c 0x1a5018438 0x1a501a740 0x10318925c 0x1031809e4 0x1031dbbcc 0x1031dd6c0 0x1031e5354 0x1031e60c0 0x1031f2644 0x1f0ac5814 0x1f0acc76c)


libc++abi.dylib: terminating with uncaught exception of type NSException



*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[RTCAudioSessionConfiguration setOnlyPlayback:]: unrecognized selector sent to instance 0x2824a7a00'


terminating with uncaught exception of type NSException


*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[RTCAudioSessionConfiguration setOnlyPlayback:]: unrecognized selector sent to instance 0x2824a7a00'


terminating with uncaught exception of type NSException
 

Max

Administrator
Staff member
Good day.
Please check if you have added -ObjC linker flag like this
1613702231034.png

Please also check if the issue is reproducing if you build the examples according to this manual.
 

AndreasBagias

New Member
Hello I have the same problem.
The session is being established but the stream fails

libc++abi: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[RTCAudioSessionConfiguration setOnlyPlayback:]: unrecognized selector sent to instance 0x282dd0200'
terminating with uncaught exception of type NSException


I have added the -ObjC flag in the Build Settings of the target

Screenshot 2021-10-30 at 10.37.12.png


I am using the FPWCSApiSwift.xcframework and WebRTC.xcframework
I have followed the https://docs.flashphoner.com/display/IOSSDK2EN/How+to+build+examples+using+Xcode+10+and+higher
to install the dependencies.

Below you can see my code:

@IBOutlet weak var remoteDisplay: RTCVideoRenderer!

//////////////////////////////////////////////////////////////////////////

let options = FPWCSApi2SessionOptions()
options.urlServer = host
options.appKey = "defaultApp"

do{

let session = try FPWCSApi2.createSession(options)

session.on(kFPWCSSessionStatus.fpwcsSessionStatusEstablished) { ses in
print("established")
if let s = FPWCSApi2.getSessions().first as? FPWCSApi2Session{

let streamOptions = FPWCSApi2StreamOptions()
streamOptions.name = self.channel
streamOptions.display = self.remoteDisplay

do{

let stream = try s.createStream(streamOptions)

stream.on(kFPWCSStreamStatus.fpwcsStreamStatusPlaying) { str in
print("stream playing")
}
stream.on(kFPWCSStreamStatus.fpwcsStreamStatusNotEnoughtBandwidth) { str in
print("stream not enough bandwidth")
}
stream.on(kFPWCSStreamStatus.fpwcsStreamStatusStopped) { str in
print("stream stopped")
}
stream.on(kFPWCSStreamStatus.fpwcsStreamStatusFailed) { str in
print("stream failed")
}

try stream.play()

}catch{
print("----stream--error-----")
print(error)
}
}
}
session.on(kFPWCSSessionStatus.fpwcsSessionStatusDisconnected) { ses in
print("disconnected")
}
session.on(kFPWCSSessionStatus.fpwcsSessionStatusFailed) { ses in
print("failed")
}
session.connect()

}catch{
print("----session--error-----")
print(error)
}




Has anyone else this problem and how did you resolve it?
Thanks in advance.
 
Top