media-server-client-js icon indicating copy to clipboard operation
media-server-client-js copied to clipboard

Adding tracks with Codecs does not work

Open mxro opened this issue 6 years ago • 0 comments
trafficstars

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.

mxro avatar Jul 27 '19 22:07 mxro