Comments (7)
Hi
Put a console.error()
in the catch block to see possible errors:
mediasoup-sample-app/client.js
Lines 147 to 151 in 391ada1
from mediasoup-sample-app.
thanks your response
i have try add console.error
from mediasoup-sample-app.
There must be an error on the server side. Run the following command before running the app to activate the log:
export DEBUG="mediasoup*"
npm start
from mediasoup-sample-app.
thanks
by debug, state === connected
run before getUserMedia
return stream
declare stream
on top scope, is ok!
i don't know why ?
from mediasoup-sample-app.
by debug, state === connected run before getUserMedia
That's impossible. The state will change to connected
just after a successful produce()
that is called inside getUserMedia()
.
Could you check the server log against possible errors?
from mediasoup-sample-app.
by debug, state === connected run before getUserMedia
That's impossible. The state will change to
connected
just after a successfulproduce()
that is called insidegetUserMedia()
.Could you check the server log against possible errors?
What you say is correct and that is the source of error. getUserMedia
defines a local stream
variable which it initialises. There before returning that stream
it invokes
mediasoup-sample-app/client.js
Line 181 in 391ada1
which causes the code in
mediasoup-sample-app/client.js
Line 129 in 391ada1
stream
variable in that closure is still undefined. After that code block is done, the control is back to producer = await transport.produce(params);
and then getUserMediareturns the
stream`.
To fix this I moved the codes https://github.com/mkhahani/mediasoup-sample-app/blob/master/client.js#L169...L181
const track = stream.getVideoTracks()[0];
const params = { track };
if ($chkSimulcast.checked) {
params.encodings = [
{ maxBitrate: 100000 },
{ maxBitrate: 300000 },
{ maxBitrate: 900000 },
];
params.codecOptions = {
videoGoogleStartBitrate : 1000
};
}
producer = await transport.produce(params);
below
mediasoup-sample-app/client.js
Line 148 in 391ada1
from mediasoup-sample-app.
@applegrew Thanks for your feedback. It's working for me. Is there possibility for race condition?
from mediasoup-sample-app.
Related Issues (20)
- Do not use latest as versions for mediasoup and mediasoup-client in package.json HOT 2
- Chrome Subscription fails - "Cannot access 'stream' before initialization" HOT 17
- Connect works, start webcam also works, but after that subscribe does not work. HOT 3
- Question about sample HOT 1
- Audio transmission problems HOT 1
- How to choose the subscription ? HOT 1
- how can I use H264? HOT 2
- ICE failed, add a STUN server and see about:webrtc for more details HOT 2
- Firefox: ICE failed, add a STUN server and see about:webrtc for more details HOT 3
- Deploying on Heroku HOT 1
- a question about the code not a issue. HOT 4
- NPM error on installing Mediasoup package HOT 2
- No audio is transmitted HOT 1
- Neither sending nor receiving video HOT 6
- Unable to receive remote video HOT 6
- trying to install and test HOT 10
- Cannot publish video HOT 1
- Audio not working HOT 1
- how to full screen and record video? HOT 1
- FYI: You don't need to use SSL on localhost! :-) HOT 1
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-sample-app.