Cordova-plugin-iosrtc: Streams are not displayed on ios but they work on the other end

Created on 22 Mar 2017  路  18Comments  路  Source: cordova-rtc/cordova-plugin-iosrtc

When I use this plugin to connect between two peers, on iOS I only see a big play button (not disabled) for both local and remote video streams. Tapping on it doesn't work. But on the other end (the other peer) I see the video stream from my iphone's camera. I tried various CSS changes to make it visible but no avail. I also added a button and set up a click handler that calls ".play()" on those video elements but it still doesn't work.

Is this a bug or am I doing something wrong?

Most helpful comment

Yes, in my case I solved a similar problem with this:
element.src = URL.createObjectURL(stream);

All 18 comments

Same issue
I think it's related to the video size

Kindly, note that i'm also facing another problem on ios devices only (Android is working fine)
THE remotesessionhandler is not firing any more

@RonyRizk I have no idea what that remotesessionhandler is.

First of all , thank you for your swift answer.
To make myself clear, I'm using the cordova plugin cordova-plugin-iosrtc:
It's working correctly on Android Devices , but on ios i'm not able to subscribe to a remote video streaming
and the remoteStreamAdded event is not firing at all on iOS devices (but on Android it works smoothly)

It's working correctly on Android Devices

The plugin does nothing on Android, it's an iOS only plugin, I can't take credit for that :-P

but on ios i'm not able to subscribe to a remote video streaming
and the remoteStreamAdded event is not firing at all on iOS devices

That definitely works, I built an app which relied on it. Please enable debugging and check the log.

Your issue doesn't seem to be related to that of @kamilkp.

I'm facing the same problem of @kamilkp and do you want any sample working code for ios

Sorry, i meant "do you have any sample working code for ios" to check where i did something wrong

Sorry, we cannot keep open an issue with so few details. Obviously remote WebRTC videos do work, otherwise this plugin would be useless.

do you have any sample working code for ios

Please, let's move to the public mailing list so others may also help.

We had the same issue. Turned out we attached the media streams with

element.srcObject = stream; // <-- wrong in iosrtc

instead of

element.src = stream; // <-- correct in iosrtc

Yes, in my case I solved a similar problem with this:
element.src = URL.createObjectURL(stream);

@saghul, using video.srcObject is indeed causing problems, and remember that we cannot rely on adapter.js tricks since adapter.js does not currently work with this plugin. I'm about sending a PR.

@fbernhard @oscarvadillog I've created a srcObject branch that should allow setting video.srcObject instead of video.src. May you try it within your app and comment in the PR #270 whether it works or not?

@ibc Nice! PR #270 looks good. Sorry, right now I'm without iOS devices... I do not think I can try it until a few weeks. Please, can you try it @fbernhard ? ;)

since adapter.js does not currently work with this plugin.

But it does. I use it.

But it does. I use it.

How?

Anyhow, this plugin must properly react on video.rcObject changes without requiring adapter.js, agreed?

es, in my case I solved a similar problem with this:
element.src = URL.createObjectURL(stream);

This solved my problem!

How?

Carefully.

Anyhow, this plugin must properly react on video.rcObject changes without requiring adapter.js, agreed?

Yes.

Hello guys,

Even I am also facing same issue. other peer i am able to see streaming. But on ios mobile i am not able play video. PluginMediaStreamRenderer.swift class file is not firing.

Was this page helpful?
0 / 5 - 0 ratings