Using mediasoup server from flutter dart client with no mediasoup-client - flutter

I want to use mediasoup server from flutter app for two use cases.
Send stream to server to record on the server side (preferring ffmpeg).
One on one or small groups up to 4 live video chats.
I would like to start with the simple option which is single stream sent to server, and for that I want to use https://github.com/ethand91/mediasoup3-record-demo as reference.
My problem is that mediasoup is not using standard offer and answer flow as I know and used to when implementing webRTC clients and in all mediasoup examples they use mediasoup-client that in fact using rtpCapabilities instead of the commonly used SDP format.
I did find this good intention repo: https://github.com/cloudwebrtc/flutter-mediasoup-client
But so far it looks like intention only.
So my question is, what's the flow I should use in order to privide the client side application with SDP, or how can I get SDP format from mediasoup transport and router rtpCapabilities.
Also, if I build the SDP myself, what should be the flow?
client-> connect ->server
server-> create-transport ->client
client-> connect-transport ->server
server-> create-producer(router rtpParameters translated to sdp offer) ->client
client-> produce(sdp answerr translated to producer rtpParameters) ->server
Does it make sense?
Any different approach also will be appreciated.
Thanks.

Use the mediasoup forum if you want authors of mediasoup to answer. We do not use Stack Overflow:
https://mediasoup.discourse.group

I started to implement it myself:
https://github.com/tan-tan-kanarek/flutter-mediasoup-client
I find that the dart webRtc stream is not giving me all the info I need regarding encoding and tracks separation.
Help will be appreciated.

Mate, you need walk through on mediasoup... you can start with javascript basics and move on to flutter as basic just works on all platform
this youtube channel is very useful on mediasoup Amir

Related

How do I create bot user with webhook on server side in MongooseIM?

This is what I want
A user(bot) that always shows status Online
When a message comes for the user, I will hit a webhook associated with the user
The response from the webhook request will be sent as reply to the sender
This user will be able to intercept any message (let's say for profanity moderation)
This user will be able to send message to anyone (let's say broadcast)
This user will come in every users roster as default(like echo bot of skype)
I can't seem to find any resource on how to achieve this. I've found a way to intercept the incoming packet in openfire but I don't see any easy way to do this with MongooseIM. I haven't started diving deep into the source code yet, still looking for a way to do this without touching the source code and locking myself to a specific version of MongooseIM.
Disclaimer: I'm on the MongooseIM core team.
There are multiple ways this could be achieved. The easiest way to achieve this depends on your familiarity with Erlang, the programming language MongooseIM is written in.
You won't need any Erlang to use the event pusher module with its HTTP backend and the default settings, but you'd need some Erlang to control what messages get forwarded to the HTTP service or to make more complex setups. To send messages back, you'd either need to use the MongooseIM REST API or connect as an ordinary XMPP client to the server using one of the many XMPP libs available out there. This is probably the best approach to achieve your goal.
You can skip using the event pusher and just connect your bot as an XMPP client written in any language whatsoever. The bot might have your business logic within or can forward messages it gets to the HTTP service.
If you're comfortable working in Erlang, then the mechanism to extend the server is called Hooks and handlers and is described in the official MongooseIM documentation. This requires writing code in Erlang and building from source, but does not necessarily require modifying upstream MongooseIM code.
You could use the XMPP component protocol, which allows to extend the functionality of an XMPP server, yet structure it as multiple services. The components may be written in any technology you want and the most popular XMPP libraries should support the component protocol out of the box.
Depending on your choice from the above list and the language and environment you prefer, you might have to pick an XMPP library to use. There are XMPP libs available for iOS (ObjC and Swift), Android (Java and Kotlin), Python, JavaScript, C, and even some emerging ones for Rust, Dart and possibly more.

What is the differce between Streams and Sockets in Flutter?

Guys what is the difference between Streams and Sockets in Flutter and when to use them?
I'm going to use Flutter in mobile app(iOS/Android) and the app is going to receive continuous flow of data coming from server, so now I'm confuced what to choose for this purpose.
*Note that performance is important.
Sockets is a real time technology related to server side which enables your back-end to push data to your client side without the need for continuous polling your server.
Streams in flutter is an object that hold reference to changing data that you can tap into it and react to the change.
these are two different concepts but they normally combined together to give you the reactive behavior wanted for your app.
hope that help you.

Where should I look for a Scala framework that supports bidirectional asynchronous communication?

I have a single server which can have multiple clients. Each client sends an asynchronous message to the server which immediately routes the message to a third party provider. At some point in the future, the server receives a response from the third party provider which should immediately be routed back to the sending client. I have had a look at Akka but had trouble figuring out how to route messages from the server back to clients at arbitrary points in the future. If I can be given some pointers even to the right parts of documentation I'm happy to take it from there. At the moment I am bewildered by the array of frameworks and options available.
"I have had a look at Akka but had trouble figuring out how to route messages from the server back to clients at arbitrary points in the future."
When a message comes in from a client, store away the reference of the sender, so you can send to it later.
Perhaps if you elaborate on the problem you experienced we can assist?
Cheers,
√
BlueEyes is designed for this kind of workflow.
You could also use atmosphere.
If your clients are browsers, you can use Lift and its comet support. This post gives you one example of doing async work using Lift

Ajax Push Engine

I'm researching methods to find ways for an event driven web application where a server can push data to the web page. Can I use APE ?? If so how can I use it and some resources please??
Thank You!!
People have been writing event driven servers since the dawn of the network. A simple google search will find your way.
However, since the client is a browser, your server must re-act upon keeping an HTTP connection open instead of simply doing socket work.
This is basically the only small difference than say an IRC server or a simple chat server.

How to push data to variety of different client types in near real time?

We need is to push sports data to a number of different client types such as ajax/javascript, flash, .NET and Mac/iPhone. Data updates need to only be near-real time with delays of several seconds being acceptable.
How to best accomplish this?
The best solution (if we're talking .NET) seem to be to use WCF and streaming http. The client makes the first http connection to the server at port 80, the connection is then kept open with a streaming response that never ends. (And if it does it reconnects).
Here's a sample that demonstrates this: Streaming XML.
The solution to pushing through firewalls: Keeping connections open in IIS
I would go with XML. XML is widely supported on all platforms and has lots of libraries and tools available for it. And since it's text, there are no issues when you pass it between platforms.
I know JSON is another alternative, but I'm not familiar enough with it to know whether or not to recommend it in this case.