Cordova-plugin-iosrtc: RTCPeerConnection.addTrack must be an instance of MediaStreamTrack

Created on 13 Jan 2021  路  8Comments  路  Source: cordova-rtc/cordova-plugin-iosrtc

Follow up from #343, getting the exact error:

@kpwa I can only help you if you provide more information.
Please provide a sample script to reproduce then I can help.

If you get this

Error: Argument 1 ('track') to RTCPeerConnection.addTrack must be an instance of MediaStreamTrack @ adapter.js:2310

That probably mean the getUserMedia is overrided by Agora is bad, try cordova.plugins.iosrtc.getUserMedia instead.

Again please provide example to reproduce your issue.

The iosrtc is already globally registered, just-in-case I also used a direct call, the error is still thrown.

boulet

Most helpful comment

(off topic, sorry)

The gUM was missing now on ios 14.3 gUM is available, but will only works with https not cordova localhost, unless you know how to get cordova server on https ;)

It's possible to serve Cordova app from the regular https server by adding the following to config.xml:

<content src="https://example.com/path/"/>

But to use Cordova API and plugins in your app also add this:

<plugin name="cordova-plugin-remote-injection" spec="https://github.com/insideAppSupport/cordova-plugin-remote-injection.git"/>

which will load Cordova and plugins API into your remote index.html as wel as into every remote URL of your app if it's multipage. Also, there is no need to upload the whole project to your server. You just have to upload the content of your www folder. The rest will be injected by cordova-plugin-remote-injection.

All 8 comments

image

The aforementioned track. The error can be suppressed but then the connection will fail.

It's thrown twice, video and audio once each.

Please update your issue to match required information and checkbox. https://github.com/cordova-rtc/cordova-plugin-iosrtc/blob/master/.github/ISSUE_TEMPLATE.md

Note: If the checkboxes above are not checked (which you do after the issue is posted), the issue will be closed, removing this checkbox will result in automatic closed issue.

Im pretty sure you have a conflicts between the SHIM and the real WebRTC.

Since I don't have this issue, you need to provide way to reproduce and all information required by issue template your did ignore on purpose.

Sure I will update the issue.

P.s. That'd be good news if it's only a conflict, although I don't understand, on WebKit there's no WebRTC, how would that be?

There is WebRTC on WKWebview since iOS 13.
The gUM was missing now on ios 14.3 gUM is available, but will only works with https not cordova localhost, unless you know how to get cordova server on https ;)

(off topic, sorry)

The gUM was missing now on ios 14.3 gUM is available, but will only works with https not cordova localhost, unless you know how to get cordova server on https ;)

It's possible to serve Cordova app from the regular https server by adding the following to config.xml:

<content src="https://example.com/path/"/>

But to use Cordova API and plugins in your app also add this:

<plugin name="cordova-plugin-remote-injection" spec="https://github.com/insideAppSupport/cordova-plugin-remote-injection.git"/>

which will load Cordova and plugins API into your remote index.html as wel as into every remote URL of your app if it's multipage. Also, there is no need to upload the whole project to your server. You just have to upload the content of your www folder. The rest will be injected by cordova-plugin-remote-injection.

You don't need all of this ;) but I'm happy if that work for you and thx for sharing.

(off topic, sorry)

The gUM was missing now on ios 14.3 gUM is available, but will only works with https not cordova localhost, unless you know how to get cordova server on https ;)

It's possible to serve Cordova app from the regular https server by adding the following to config.xml:

<content src="https://example.com/path/"/>

But to use Cordova API and plugins in your app also add this:

<plugin name="cordova-plugin-remote-injection" spec="https://github.com/insideAppSupport/cordova-plugin-remote-injection.git"/>

which will load Cordova and plugins API into your remote index.html as wel as into every remote URL of your app if it's multipage. Also, there is no need to upload the whole project to your server. You just have to upload the content of your www folder. The rest will be injected by cordova-plugin-remote-injection.

That's one hell of a workaround for something apple doesn't care to fix 馃槖馃榾 good to know though, would be handy if all else fails 馃憤馃徎

@hthetiot
I had followed the discussion on WebRTC implementation for WebKit on their website, but the thread was rather contradictory, it's good to know for certain what's implemented and what's not.

Thanks @hthetiot for pointing me to the right direction, I confirm there was a conflict bw WebKit's implementation and iosrtc 馃憤馃徎

Was this page helpful?
0 / 5 - 0 ratings