Twilio-video.js: After track.stop(), trying re-attach track. Video/Audio not recover.

Created on 27 Feb 2019  路  10Comments  路  Source: twilio/twilio-video.js

Hi Twilio,

I have featured in my app to temporary close the webcam (disconnect) from the video chat.

I have two participant in a room, then I detach them and on detaching I called stop() method of local tracks, (require to disappear the red icon on the tab), after that I re-attach the tracks again by using room.localParticipant.tracks and room.participant.tracks

Issue: The tracks get re-attached that is audio/video elements are in the DOM but not working.

Quest List

  1. Question: Do I have to leave the room and reconnect the room, instead what I am doing?
  2. Question: Do I have to re-create the local tracks and publish them on Room?
  3. Question: If so, do multiple tracks attached to a participant on the server side?
  4. Question: Is there a better approach to my case?

Will be waiting for the quick response thanks.

question

Most helpful comment

@smkrn110 ,

An ad-hoc Room (a Room which is created the moment the first Participant joins) will exist as long as there is at least one Participant is in the Room, irrespective of whether any media is being published. A REST Room (a Room created by using the REST API) will exist even if there are no Participants, and can only be torn down by calling another REST API.

Hope this clears things up for you.

Thanks,

Manjesh Malavalli
JSDK Team

All 10 comments

@smkrn110 ,

Once you stop a LocalMediaTrack, you can't use it again. I suggest you do the following:

  • Unpublish the LocalMediaTracks you want to stop.
  • Stop the LocalMediaTracks.
  • Create new LocalMediaTracks using Twilio.Video.createLocalTracks().
  • Publish them to the Room.

Please let me know if this works for you. I will close the issue since this is more of a question than an issue.

Thanks,

Manjesh Malavalli
JSDK Team

@manjeshbhargav Thanks, great.

@manjeshbhargav

I don't know you get intimate on the close issues if not will open another issue? However, I have a question here related to this.

If all the participants in a room have unpublished their tracks, what will be the chance if users not (re-enable video chat) republished their tracks for a long time but as they try to do it again, the room might be not available?

To be precise is there a chance if the participant's tracks in a room not available for a long time, the room gets disconnected automatically.

@smkrn110 ,

An ad-hoc Room (a Room which is created the moment the first Participant joins) will exist as long as there is at least one Participant is in the Room, irrespective of whether any media is being published. A REST Room (a Room created by using the REST API) will exist even if there are no Participants, and can only be torn down by calling another REST API.

Hope this clears things up for you.

Thanks,

Manjesh Malavalli
JSDK Team

Thanks @manjeshbhargav

@manjeshbhargav

Can we have rights to open an issue with labeled question :-)

Well back again to ask some question actually I have asked this question on slack and also try contacting from the support form on the web. All are related to how/ when Twilio does charge for its services with technical aspects all related to Programmable Video.

Questions are as follows:

Q1) When room joined and no participants yet attached?
Q2) When after joining and all the participants detached from the room?
Q3) If multiple tracks get published?
Q4) Do price differ when users join the room

  • with both the tracks
  • with an only audio track
  • with no tracks

Q5) What if all participants left and rooms not get completed does it cost too?
Q6) When users temporary unpublished and published the tracks?

If any area left kindly answer it too.

Thanks

@manjeshbhargav
Kindly response on this too.

@smkrn110 ,

I will forward this question to our PM @aymenn who is in a better position to comment on pricing.

Thanks,

Manjesh Malavalli
JSDK Team

Hey @smkrn110,

Rooms are charged on a participant minute basis and the rate depends on the type of Room.

Charging for the participant starts as soon as the participant joins and stops as soon as that participant leaves. This rate is fixed whether voice or video tracks are being published or not.

Note, Data tracks are charged by the number of messages sent by participants (not by the number received by participants)

See https://www.twilio.com/video/pricing for further pricing details

Please dont hesitate to let me know if you need further clarifications!

@aymenn

Thanks for the reply.

'..on participant minutes basis...'

Can you elaborate the above line. Second you mean to say, charges are per participant' time spend in that room, with or without any tracks?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gregoryjjb picture gregoryjjb  路  3Comments

vsrboth picture vsrboth  路  3Comments

tapannathvani picture tapannathvani  路  5Comments

antonlive picture antonlive  路  5Comments

HandsomeMedia picture HandsomeMedia  路  3Comments