Comments (10)
Hello. Write in more detail about your problem, the scenario of its execution and environment. Validate your incoming consumer data.
from mediasoup-client-flutter.
@Blancduman
Thank you for your reply,
It happens on both Android and iOS. The scenario is that I have 2 producers (video & audio) that need to be consumed so I create 2 ReceiveRransport to consume those producers.
My code of consuming part is something like this:
Socket.connection.emitWithAck('consume', {
'peerId': participantId,
'transportId': recvTransport.id,
'producerId': producerId,
'rtpCapabilities': _device.rtpCapabilities.toMap(),
}, ack: (response) async {
recvTransport.consume(
id: response['id'],
peerId: response['id'],
producerId: response['producerId'],
kind: RTCRtpMediaTypeExtension.fromString(response['kind']),
rtpParameters: RtpParameters.fromMap(response['rtpParameters']),
accept: () {});
});
The parameters that I passed to .consume(...) are correct but after .consume() is called it throws an error randomly saying that "Null check operator used on a null value". I traced the error log I found that this code await _pc!.setRemoteDescription(offer);
throw an error because occasionally it has null value.
This is the full log from debug console:
logs.txt
from mediasoup-client-flutter.
I look into mediasoup_client_flutter/…/handlers/unified_plan.dart
file and found the Future<HandlerReceiveResult> receive(HandlerReceiveOptions options)
method is being invoked before peerConnection is ready.
@override
Future<HandlerReceiveResult> receive(HandlerReceiveOptions options) async {
...
_pc!.setRemoteDescription(offer);
...
}
I found this information on mediasoup website he said "It receives a RTP packet of the new consumer before the remote RTCPeerConnection is ready to process it." and he recommended setting paused: true
on first to prevent this but somehow still Future<HandlerReceiveResult> receive(HandlerReceiveOptions options)
method is being invoked before peerConnection is ready and caused the error.
from mediasoup-client-flutter.
Try the next one:
accept
should be callback function that comes from yourresponse
. Call it, when you ready to consume, from function that you passed torecvTransport
consumer callback.- Weird, but still, check your
appData
. I don't know how your backend work, so maybe your backend depend on some data insideappData
. (case from my experience). - Permissions? (hehe)
Really complicate to tell for me, without whole pipeline. Ignoring what I wrote above, everything look good. Maybe you missed step in loading device? but that happens randomly.
from mediasoup-client-flutter.
accept
is from the server side ?- I didn't use any
appData
any data. 😄 - I doubled check permissions are good.
Actually, it's not random it happens every time on the app first run because PeerConnection needs time to be ready before it can be used by this function Future<HandlerReceiveResult> receive(HandlerReceiveOptions options)
but it was triggered before PeerConnection is ready that is why it throws an error. What causes the receive
function to be triggered?
Well, I think it will produce an error when trying to consume producers after app fresh run. So I ran [mediasoup_client_flutter_example](https://github.com/Blancduman/mediasoup_client_flutter_example)
trying to see its behavior but I can't join an existing room. The roomId
always shows null
even if I input a valid room id. Could you help look into that?
from mediasoup-client-flutter.
You should put whole link to example.
Without code, I can't tell much. Maybe you forget await
somewhere.
from mediasoup-client-flutter.
About accept
, check mediasoup demo (js version)
from mediasoup-client-flutter.
@Blancduman Thank for your reply. I've been testing with remote mediasoup server and it's working fine but not with local.
-
Senario 1 (Error)
Running local mediasoup server on my Mac machine also Peer1 on the same machine then Peer2 running on my mobile phone it produces the error. -
Senario (No Error)
Running a remote mediasoup server on AWS. Peer1 on a Mac machine then Peer2 running on my mobile phone it doesn't produce the error.
I still can't figure out why this happened. Maybe Peer1 and server have the same IP address? I will test more to see if it will happen after using a remote server too or not.
from mediasoup-client-flutter.
@un-hongly I have the same issue, did you find out how to fix it?
from mediasoup-client-flutter.
@un-hongly I have the same issue, did you find out how to fix it?
I still haven't found any solution yet but as I said above when I test it with the remote server it rarely to happens but with the local server it occur every time my app fresh start.
from mediasoup-client-flutter.
Related Issues (20)
- Video and screenshot freezes when iOS is backgrounded
- Click to close the camera to report an error
- Voice calls on iOS are too low HOT 2
- The rear camera image is flipped 180 degrees HOT 2
- Remote video is blurry
- iOS audio always on speaker and can't switch to earpiece HOT 2
- how to broadcast one to many HOT 3
- load.device error
- Video images display problems
- Android phone sharing screen crash
- Transport.Produce(): type 'String' is not a subtype of type 'int' HOT 3
- transport.produce(): Null check operator used on a null value
- Why "maxRetransmits" is "required" in Transport.produceData()? HOT 2
- Transport connection state changed to Failed HOT 11
- Info regarding architecture and the mediasoup server compatability
- Send Transport "produce" listener not running on .produce() HOT 3
- update ..
- issue regarding not able to produce
- createSendTransportFromMap not connecting
- video stop after passing after sometime
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mediasoup-client-flutter.