Hello,
I’ve started working on the iOS side of libmediasoup.
I am a complete newbie when it comes to iOS development and I’ve never ported C++ to Objective-C/Swift, so if anyone can help me It would be greatly appreciated.
For now I think I’ve got the base blueprint sorted, and I’m trying to port C++ to Swift (Following various tutorials…)
Great! BTW it would be great if your project and this one (mediasoup-client-android) become somehow similar in their design. Remember that you do not need to port any C++ code to ObjC but just use the C++ API exposed by libmediasoupclient and provide an ObjC wrapper for its API.
@ibc
For clarity I will try to implement it as close to the android SDK as possible.
From what I’ve read it seems the below is the best approach?
libmediasoup C++ -> Objective-C++ Wrapper -> Objective-C Wrapper.
The above allows objective-c user’s with zero knowledge of c++ to use the library, and with a bridging header also allows Swift users to use the library.
If anyone has a better approach/example implementations please share.
For now I’ll work on the Objective-C++ Wrappers
I’m not an expert in Objective C/C++. Just wondering, why not going directly to Swift instead?
Unfortunately this can not be done, We need a way to “port” the c++ object to objective-c/Swift.
Sort of like an iOS version of Android JNI.
For example:
C++ mediasoupclient::Consumer → Objective-C++ (mediasoupclient::Consumer to NSObject) → Objective-C (NSObject)
Swift users will need to use a bridging header to be able to use the Objective-C header.
Update:
All of the base libmediasoupclient has been implemented.
There are still some small things that need to be implemented, which will be complete once I’ve tested it on a sample application.
There is people contributing to mediasoup by making those native SDKs for iOS and Android. That’s a good point to start. You may try them and provide your feedback so there is more people involved into this. We, the authors, do the max we can do taking into account that this is an Open Source project.
Still needs a couple of tweaks etc. Also trying to upload it to cocoapods for smoother implementation.
Be grateful if anyone could try to use the library and give me any feedback/advice. (iOS is not my strong point ;))
Thinking of adding the mediasoup-ios-client documentation to the mediasoup website, would this be ok?
We’ll love to have it in the mediasoup website. However, before that we really need to take a depth look into the code to be able to properly document it and provide support here about it if needed. Unfortunately we are specially busy these weeks and it’s not a good timing for it. We promise we’ll do it in the future. In the meanwhile, please document all the API in the README (or wherever you prefer).
However, what do you mean with “Ability to communicate with mediasoup-demo”? It’s up to you, but I would not include any WebSocket nor a demo specific stuff into the lib.
However, what do you mean with “Ability to communicate with mediasoup-demo”?
What I meant was having a sample that communicates with the mediasoup-demo, therefore you don’t need to implement the server side in order to test it out.
Pretty much the iOS version of this sample:
It’s up to you, but I would not include any WebSocket nor a demo specific stuff into the lib