twilio / twilio-video.js

Twilio’s Programmable Video JavaScript SDK
https://www.twilio.com/docs/video/javascript
Other
567 stars 216 forks source link

Unable to attach participant media #25

Closed Keerthi-harish closed 7 years ago

Keerthi-harish commented 7 years ago

I'm building a video conference application, previously which was using Twilio conversation API. As per recent updates from Twilio, I tried the Rooms API with reference of twilio's quick start app. I'm facing problem attaching the remote participant media and trying to figure out for more than a week. Please find code sample here and logs for the same.

I have posted for the same in stackoverflow and got some suggestions which didn't help me.

Note: I'm using Ember JS on front and Ruby on Rails on back end. I also use action-cable to share details between participants.

Ember Environment: ember-cli: 2.4.3 node: 4.4.3 os: linux x64, 14.04

Ruby Environment: Ruby version: 2.3.1 Rails version: 5.0.0.1 Rails action cable: 5.0.0.1

manjeshbhargav commented 7 years ago

Hi @Keerthi-harish ,

I tried to reproduce your issue, but wasn't successful. I was able to see the remote media. So I was wondering if you could provide some additional information, like:

  1. Did you get the participantConnected event when the second person entered the room?
  2. If you did, then after you called participant.media.attach('#remote-media'), did you see that the audio and video elements were created within div#remote-media?
  3. What browser and version were you trying to run the code in?

Thanks,

Manjesh (JS SDK Engineer)

Keerthi-harish commented 7 years ago

@manjeshbhargav Thanks for your reply.

  1. On second person joining the room, participantConnected event is triggered properly.
  2. Video and audio elements are not created on participant.media.attach('#remote-media') method.
  3. I assume you tried to reproduce the issue in Ember js environment and my browser is google-chrome 53.0.2785.116 (Official Build) (64-bit). Note: I also tried with new releases
manjeshbhargav commented 7 years ago

@Keerthi-harish ,

Can you give me a list of all the js libraries you've included along with their script tag urls?

Thanks,

Manjesh

Keerthi-harish commented 7 years ago

@manjeshbhargav Following are the libraries I have included.

Removing webrtc adapter.js made application work. Now I'm able to attach participants media. But why is this happening? :thinking:

kmahlqvist commented 7 years ago

Hi @Keerthi-harish

I had the same problem. When you attach the remote stream a listener for the stream to be added is set up. But adapter is in blocking this event so is simply never attached. I didn't check any further into this as I don't really need adapter.js. But atleast there's pointer for you.

manjeshbhargav commented 7 years ago

Hi @Keerthi-harish ,

I think I know what the reason is. We actually shim some PeerConnection functionality that is not present in Chrome. I think adapter.js screws up our shims. So I don't think you need to use adapter.js if you are using twilio-video.js.

markandrus commented 7 years ago

We will look into supporting twilio-video.js in pages that are already loading adapter.js.

jteplitz commented 7 years ago

Hi @manjeshbhargav,

I'm running into a similar issue where I have adapter.js providing a shim to a plugin in Safari, but when adapter js is loaded on the page twilio-video (beta 4) doesn't fire any trackAdded events for remote participants. Can you provide a bit more info about how you think the shims are interfering?

manjeshbhargav commented 7 years ago

Hi @jteplitz602 ,

We have shimmed some methods of PeerConnection ourselves for a number of reasons, ex: for rollback support on chrome, for plan-b to unified-plan sdp support, etc. Also, in our shims, we listen to MediaStream#onaddtrack and PeerConnection#onaddstream events to detect when a new MediaStreamTrack is added, as a result of which we fire a trackAdded event on the Room. So adapter.js most likely will override these shims.

Hope this answers your question.

Can you give me more info about the plugin you are using?

Thanks,

Manjesh

jteplitz commented 7 years ago

Thanks Manjesh!

I'm loading in the temasys adapter.js shim before loading the twilio-video library

manjeshbhargav commented 7 years ago

Hi @jteplitz602 ,

At this stage, we don't have any plans to support the temasys plugin (or any non-webrtc browser) as it stands now.

Thanks,

Manjesh

markandrus commented 7 years ago

I will close this issue in favor of tracking on the higher-visibility ticket https://github.com/twilio/twilio-video.js/issues/132

markandrus commented 7 years ago

This is now fixed in twilio-video@1.1.0 as well as recent versions of adapter.js.