Closed jayeshkv closed 4 years ago
@jayeshkv,
First, I want to make sure I understand your setup correctly. You are using the MultiPartyExampleApp as a basis for adding TwilioVideo into your application and as such:
MultiPartyViewController.swift
file into your application and have added a way to bring it up in your application.MultiPartyViewController.swift
and created a model object, videoutil
to contain them so they don't go out of scope when you navigate away from the MultiPartyViewController
view controller.MultiPartyViewController.swift
to access the objects in videoutil
.Does that sound right so far? I am assuming the idea here is that users join a multiparty call.. Then if they want to go back to the general idea of your application, but staying in the room, they would leave the MultiPartyViewController
and navigate around your app. Being that the model object is still alive, things should still exist. The problem then is when you want to display MultiPartyViewController
again, nothing is wired up and working. Does that sound about right?
I think the idea of having a model object that encapsulates the TwilioVideo logic is a sound idea. Things to keep in mind, however, are when setting delegates to the Twilio objects. For instance, when calling TwilioVideoSDK.connect
, you provide the room delegate. We maintain a weak reference to that object to avoid a retain cycle. If you then destroy the MultiPartyViewController
, the delegate on the Room
object will no longer exist, and you will not receive call backs.
I think if I were going with this approach, I would make VideoUtil
a fully featured model object that implements all of the delegate callbacks you will need to receive in your application. I would imagine that that object would have it's own delegate object (the view controller displaying the video UI) and when that delegate is set and the UI exists, modifications to the UI would be propagated thought. As far as how to get a new view controller displayed with the contents of the current state of the UI, you would need to inspect the objects in your VideoUtil
class and rebuild the UI with the current state. The MultiPartyViewController
is a good start, but it is not currently designed to operate as you are trying. The idea behind that view controller is that it is alive for the duration of the video communication. When the video communication is complete, it cleans up and goes away.
I think that may be the intent of your question. If I am completely off base, please let me know.
Ryan
Hi @paynerc
Whatever you explained is how the current application works and is what I am trying to achieve. Thanks for the clarification.
Does the explanation I provided unblock you so you can continue development?
I am going to close this issue but feel free to reopen it or create a new issue if you run into any further issues.
Ryan
Hi @paynerc
whatever you mentioned makes sense, thanks.
I have followed this version of Multiparty example
https://github.com/twilio/video-quickstart-ios/tree/9fffebbef4f2d3cb2a5cf78bcb76949939c810f8/MultiPartyExample
Description
I have integrated the Multiparty example in our application, The room name gets passed in dynamically via the token as well as in the code to connect to the room.
I have created static class variables that would help keep the room connection open even if the party tries to switch between view controllers and made sure deinit doesn't get called when you have the connection open (I am trying to keep the video feed open so that the party would be able to go back and check any specific info).
I am trying to reuse the existing
remoteparticipants
present in thevideoutil.room
and add those remoteparticipants to the containerView instead of connecting to the same room again with a token and updating the containerViewI have tried to check if the room has participants via
How would i refresh the view to use the existing connection instead of calling
TwilioVideoSDK.connect
If I directly call the delegate method
roomDidConnect(videoutil.room)
in viewdidload() It isn't setting up the remoteparticipant views and the remoteparticipant shows up as blank