iOS native client support

VP9 support (iOS does not enable VP9 support by default)

Supported!

Bitcode support

mediasoup ios supported, however due to the size of WebRTC.framework with bitcode it cannot be uploaded to github without lfs… WebRTC.framework would need to be build locally if bitcode is required.

1 Like

How to enable VP9 and H264

I updated your issue.

I need to update which library on GitHub?

You would need to build the webrtc libraries with h264 enabled.

You can use the below as a reference:

Please redirect all issues to the github page, with a lot more detail.

API Documentation added.

1 Like

:partying_face:

Hi ethand91, Do you have any iOS client repo which can communicate with mediasoup-demo.

Thanks

Not yet, sorry.

Thanks ethand91.
Are you building Chat message support in iOS client repo (consumeData event) ?

Are you building Chat message support in iOS client repo (consumeData event) ?

Will consider implementing it :slight_smile:

1 Like

Is ios library by ethand91 in working condition? I tried implementing with mediasoup protoo server backend. But I am getting error when calling when calling sendTransport.produce()…

[ERROR] transport_wrapper::+TransportWrapper nativeProduce:listener:track:encodings:codecOptions:appData: | The associated promise has been destructed prior to the associated state becoming ready.

Can anyone please help?

Hi do you implemented Simulcast means group video calling, If yes please help me.

Help to what? Are you asking for free consultancy?

I haven’t tried using mediasoup protoo server…

The problem is that you are probably calling the produce callback on a different thread. Could you try calling the produce callback on the same thread you called produce on?

thanks for the reply, I am done with 1 to 1 mediasoup and for 1 to many. handled like below
I am taking from this https://github.com/ethand91/mediasoup-ios-client-sample
for new peer added
case “newPeer”:
isRemoteVideo = true
self.handleNewConsumerEvent(consumerInfo: data![“data”])

and and added for video added like below
extension VideoCallVC : RoomListener {
func onNewConsumer1(consumer: Consumer) {
print(“RoomListener::onNewConsumer kind1=” + consumer.getKind())
print(consumer.getTrack())
if consumer.getKind() == “video” {
let videoTrack: RTCVideoTrack = consumer.getTrack() as! RTCVideoTrack
videoTrack.isEnabled = true

        videoTrack.add(self.videoRemoteCamera1)
        
    }
    
    do {
        
        consumer.getKind() == "video"
            ? try self.client!.resumeRemoteVideo1()
            : try self.client!.resumeRemoteAudio()
    } catch {
        print("onNewConsumer() failed to resume remote track")
    }
}
...... And help means i am stuck at this place bro, Please tell me bro is i need to pay something.

Ok, finally promise issue is resolved. But after produce, the video is not showing on mediasoup demo server from ios. The resolution is showing as 0x0. But audio producing is successful. What am I doing wrong?

    private func produceVideo(){
        
        let devices = AVCaptureDevice.devices(for: .video)

        // Start capturing it
        let factory = RTCPeerConnectionFactory()
        let videoCapturer = RTCCameraVideoCapturer()
        videoCapturer.startCapture(with: devices[0], format: devices[0].activeFormat, fps: 30)
        let videoSource = factory.videoSource()
        videoSource.adaptOutputFormat(toWidth: 640, height: 480, fps: 30)

        let videoTrack = factory.videoTrack(with: videoSource, trackId: "ARDAMSv0")
        
        let codecOptions: JSON = [
            "videoGoogleStartBitrate": 1000
        ]
        
        let produceHandler = ProduceHandler()
        produceHandler.delegate = produceHandler
        
        
        let producer = sendTransport?.produce(produceHandler.delegate, track: videoTrack, encodings: nil, codecOptions: codecOptions.description)
        
    }
private class SendTransportHandler : NSObject, SendTransportListener {
        fileprivate weak var delegate: SendTransportListener?
        private var socket: EchoSocket
        
        init(mSocket: EchoSocket) {
            self.socket = mSocket
        }
        func onConnect(_ transport: Transport!, dtlsParameters: String!) {
            print("Current Thread Send Handler 2: \(Thread.current)")
            
            var json = JSON()
            json["transportId"].string = transport.getId()
            json["dtlsParameters"] = JSON.init(parseJSON: dtlsParameters!)
            
            let jsonReturn = Request.shared.connectWebRtcTransport(socket: self.socket, json: json)
            print("SendTransport::onConnect: \(jsonReturn)")
        }
        
        func onConnectionStateChange(_ transport: Transport!, connectionState: String!) {
            print("SendTransport::onConnectionStateChange connectionState = " + connectionState)
        }
        
        func onProduce(_ transport: Transport!, kind: String!, rtpParameters: String!, appData: String!, callback: ((String?) -> Void)!) {
            print("SendTransport::onProduce connectionState = " + rtpParameters)
            
            
            let rtpParam = JSON.init(parseJSON: rtpParameters)
            print("rtpParameters \(rtpParam)")
            
            var json = JSON()
            json["transportId"].string = transport.getId()
            json["kind"].string = kind
            json["rtpParameters"] = rtpParam
            json["appData"].string = appData
            
            print("onProduce JSON: \(json)")
            
            let jsonReturn : JSON = Request.shared.produce(socket: self.socket, produceJson: json)
            print("onProduce JsonReturn: \(jsonReturn)")
            let producerId = jsonReturn["data"]["id"].string
            print("onProduce ProducerID: \(producerId ?? "NA")")
            callback(producerId)
        }
    }

I am unable to consume anything as I never get the “newConsumer” events. It is odd since I do receive other events such as “newPeer” or “activeSpeaker". Any help is appreciated.

Please don’t ask the same question is different threads. There is no “newConsumer” event in mediasoup libraries, that’s demo stuff.