Using the HTTP API steps needed to get the stream to the server

I am creating an iOS application where basic real-time streaming required

  • Broadcaster/host streaming video/audio in a room
  • Guests join room and stream video/audio

I have integrated mediasoup-ios-client and the web socket iOS library Starscream on the client-side.
For the server I copied the mediasoup-demo server since all the capabilities needed already written there and found it a good place to move fast and understand the mediasoup API better.

I am listing below the steps I am taking and successfully implemented so far in iOS client.

  1. websocket is connected: ["Origin": "wss://", "Upgrade": "websocket", "Sec-WebSocket-Accept": "9XBEhU0BaApchES+R3iu5FH23OY=", "Connection": "Upgrade", "Sec-WebSocket-Protocol": "protoo"]
  2. Mediasoupclient.initialize()
  3. HTTP API getRoomRtpCapabilities ('/rooms/:roomId')
  4. MediasoupDevice.init
  5. MediasoupDevice.load(rtpCapabilities)
  6. mediasoupDevice!.isLoaded() => true
  7. HTTP API createBroadcaster ('/rooms/:roomId/broadcasters') => {"peers":[]}
  8. HTTP API createBroadcasterTransport ('/rooms/:roomId/broadcasters/:broadcasterId/transports') => { "iceCandidates" : [ ... ], "dtlsParameters" : { "fingerprints" : [ ... ], "role" : "auto" }, "id" : "...", "iceParameters" : { ... } }
  9. HTTP API connectBroadcasterTransport ('/rooms/:roomId/broadcasters/:broadcasterId/transports/:transportId/connect') => It looks like I don’t receive any JSON response here

Do I need to create a Producer ('/rooms/:roomId/broadcasters/:broadcasterId/transports/:transportId/producers') and a Consumer ('/rooms/:roomId/broadcasters/:broadcasterId/transports/:transportId/consume') for the broadcaster/host as next steps?

Client-side after creating the broadcaster transport do I need to cal MediasoupDevice.createSendTransport and MediasoupDevice.createRecvTransport.

Still wrapping my head around the communication needed, I appreciate your help.


You’re taking a simple demo to build a product or service out of it. Beware that we don’t provide support further than its use as it is.

This is the documentation for client-server communication:

On the other hand, I’m quite sure you are already checking the mediasoup-broadcaster-demo which handles good part of what you are asking for.

1 Like

I agree, I am really looking into practices and flow to learn and will refactor as soon as I get it up and running and have the knowledge (e.g. rooms and peers into a DB, add authentication/authorization).

The room/peers concept I need is there, I just want to have a proof of concept, in no means I tend to use as is in production :slight_smile:

OK, I need to dive back to this documentation!
I didn’t really dive in mediasoup-broadcaster-demo, getting into it right away.

@jmillan thank you for the response, sometimes handling new tech (WebRTC) and frameworks (mediasoup) + new languages to learn (Swift, TypeScript) you need community support like this one! I appreciate your help.

1 Like