Esempio n. 1
0
        public void OnIncoming(Proxy callback)
        {
            ExecuteAction.InState <AVModality>(client, ModalityTypes.AudioVideo, ModalityState.Notified, (conversation, modality) =>
            {
                var inviter = (Contact)conversation.Properties[ConversationProperty.Inviter];

#pragma warning disable 1998
                Proxy AcceptCall = Bindings.CreateAction((dynamic kwargs) =>
                {
                    modality.Accept();
                    if (kwargs.fullscreen)
                    {
                        CallWindow.ShowFullscreen(automation, conversation, kwargs.display);
                    }
                });

                Proxy RejectCall = Bindings.CreateAction((dynamic kwargs) => modality.Reject(ModalityDisconnectReason.Decline));
#pragma warning restore 1998

                callback(new
                {
                    inviter = new UserDetails(inviter),
                    actions = new
                    {
                        accept = AcceptCall,
                        reject = RejectCall
                    }
                });
            });
        }
Esempio n. 2
0
 public void Call(List <string> participants, bool fullscreen = true, int display = 0)
 {
     automation.BeginStartConversation(
         AutomationModalities.Video,
         participants,
         null,
         (ar) =>
     {
         ConversationWindow window = automation.EndStartConversation(ar);
         if (fullscreen)
         {
             CallWindow.ShowFullscreen(window, display);
         }
     },
         null);
 }
Esempio n. 3
0
        public void JoinMeeting(string url, bool fullscreen = true, int display = 0)
        {
            automation.BeginStartConversation(
                url,
                0,
                ar =>
            {
                ConversationWindow window = automation.EndStartConversation(ar);

                if (fullscreen)
                {
                    var av = window.Conversation.Modalities[ModalityTypes.AudioVideo];
                    ExecuteAction.InState(av, ModalityState.Connected, (modality) =>
                    {
                        CallWindow.ShowFullscreen(automation, modality.Conversation, display);
                    });
                }
            },
                null);
        }
Esempio n. 4
0
        public void OnConnect(Proxy callback)
        {
            ExecuteAction.InState <AVModality>(client, ModalityTypes.AudioVideo, ModalityState.Connected, (conversation, modality) =>
            {
                var participants = conversation.Participants.Where(p => !p.IsSelf).Select(p => new UserDetails(p.Contact));

#pragma warning disable 1998
                Proxy Fullscreen = Bindings.CreateAction((dynamic kwargs) => CallWindow.ShowFullscreen(automation, conversation, kwargs.display));

                Proxy Show = Bindings.CreateAction((dynamic kwargs) => CallWindow.Show(automation, conversation));

                Proxy Hide = Bindings.CreateAction((dynamic kwargs) => CallWindow.Hide(automation, conversation));

                Proxy Mute = Bindings.CreateAction((dynamic kwargs) => SetMute(conversation, kwargs.state));

                Proxy StartVideo = Bindings.CreateAction((dynamic kwargs) => this.StartVideo(conversation));

                Proxy StopVideo = Bindings.CreateAction((dynamic kwargs) => this.StopVideo(conversation));

                Proxy End = Bindings.CreateAction((dynamic kwargs) => EndConversation(conversation));
#pragma warning restore 1998

                callback(new
                {
                    participants = participants,
                    actions      = new
                    {
                        fullscreen = Fullscreen,
                        show       = Show,
                        hide       = Hide,
                        mute       = Mute,
                        startVideo = StartVideo,
                        stopVideo  = StopVideo,
                        end        = End
                    }
                });
            });
        }