medooze / media-server-client-js Goto Github PK
View Code? Open in Web Editor NEWMedia Server Client
License: MIT License
Media Server Client
License: MIT License
when I run the second command 'npm run-script dist' , I get the following error:
===============================
[email protected] dist /Users/lichao/Downloads/media-server-client-js
browserify --standalone MediaServerClient lib/MediaServerClient.js -o dist/medooze-media-server-client.js && cp dist/* demo/www
sh: browserify: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] dist: browserify --standalone MediaServerClient lib/MediaServerClient.js -o dist/medooze-media-server-client.js && cp dist/* demo/www
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] dist script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/lichao/.npm/_logs/2018-11-15T03_09_09_545Z-debug.log
MediaServerClient can't establish connection, either with or without using adapter.js
I can reproduce this using Chrome (dev) Version 104.0.5112.20 (Official Build) beta (64-bit), while the same code works in v.103 or even into a browserstack's (vm?) Windows 11 Version 104.0.5083.0 (Official Build) beta (64-bit)
Console (error):
Uncaught (in promise) DOMException: Failed to execute 'setRemoteDescription' on 'RTCPeerConnection': Failed to parse SessionDescription. a=rtpmap:0 pcmu/8000 Duplicate statically assigned payload type with conflicting codec name or clock rate. at PeerConnectionClient.renegotiate (https://.../mmsc.js?r=1656413494:2663:17) at new PeerConnectionClient (https://.../mmsc.js?r=1656413494:2398:8) at MediaServerClient.createManagedPeerConnection (https://.../mmsc.js?r=1656413494:2273:10)
To properly enable fixing a codec with simulcast the codecPayloadType
of the sendEncodings
should be filled when calling addTransceivers
.
We can retrieve the codec payloads from the initialization SPP O/A transceivers and do a lookup before adding the simulcast transceiver.
The close method seems have some issues.
https://github.com/medooze/media-server-client-js/blob/master/lib/PeerConnectionClient.js#L490
I think that the correct one should be:
stop() { //Stop peerconnection this.pc.close(); //Stop namespace this.ns.close(); //Null this.pc = null; this.ns = null; }
Instead to call to stop
method, we need to call to close
method, to stop the peer connection and the namespace
I've tried running the demo and documented the steps I followed here https://maxrohde.com/2019/07/28/medooze-media-server-demo/
It shows both the local and remote track when either clicking [Add normal track] or [Add simulcast track]. However, when trying to add a track with VP8 or H264, the following exception is thrown and only the local stream is rendered:
Uncaught (in promise) TypeError: Cannot read property 'getType' of undefined
at PeerConnectionClient.renegotiate (medooze-media-server-client.js:2455)
renegotiate | @ | medooze-media-server-client.js:2455
-- | -- | --
| async function (async) | |
| renegotiate | @ | medooze-media-server-client.js:2403
| PeerConnectionClient.pc.onnegotiationneeded | @ | medooze-media-server-client.js:2249
Seems to work fine when manually skipping the logic for overriding the codecs. But I don't have sufficient understanding of this to know if this is safe to do or not.
//For all transceivers
for (const transceiver of this.pc.getTransceivers())
{
//If we have to override the codec
if (transceiver.codecs && transceiver.mid)
{
//Get local media
const localMedia = this.localInfo.getMediaById(transceiver.mid);
//console.log(this.remote.capabilites);
//Get remote capabilities
const capabilities = null; // this.remote.capabilities[localMedia.getType()];
//If got none
if (!capabilities)
//Skip
continue;
I'm running this on Chrome and Ububtu.
Sorry about limited info, I can only partially debug a remote client, but what I've seen is that peer.localInfo has an empty candidates array, and peer.connectionState / peer.iceConnectionstate are stuck at "new". Any hint
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.