コード例 #1
0
        public void StartChat(string userAlias, List <BandyerSdkForms.ChatWithCallCapability> callCapabilities, List <BandyerSdkForms.InCallCapability> inCallCapabilities, List <BandyerSdkForms.InCallOptions> inCallOptions)
        {
            CallCapabilities capabilities = new CallCapabilities();

            if (inCallCapabilities.Contains(BandyerSdkForms.InCallCapability.Whiteboard))
            {
                capabilities.WithWhiteboard();
            }
            if (inCallCapabilities.Contains(BandyerSdkForms.InCallCapability.FileSharing))
            {
                capabilities.WithFileSharing();
            }
            if (inCallCapabilities.Contains(BandyerSdkForms.InCallCapability.Chat))
            {
                capabilities.WithChat();
            }
            if (inCallCapabilities.Contains(BandyerSdkForms.InCallCapability.ScreenSharing))
            {
                capabilities.WithScreenSharing();
            }

            CallOptions options = new CallOptions();

            if (inCallOptions.Contains(BandyerSdkForms.InCallOptions.CallRecording))
            {
                options.WithRecordingEnabled(); // if the call started should be recorded
            }
            if (inCallOptions.Contains(BandyerSdkForms.InCallOptions.BackCameraAsDefault))
            {
                options.WithBackCameraAsDefault(); // if the call should start with back camera
            }
            if (inCallOptions.Contains(BandyerSdkForms.InCallOptions.DisableProximitySensor))
            {
                options.WithProximitySensorDisabled(); // if the proximity sensor should be disabled during calls
            }

            BandyerIntent.Builder builder           = new BandyerIntent.Builder();
            ChatIntentBuilder     chatIntentBuilder = builder.StartWithChat(MainActivity.Application /* context */);
            ChatIntentOptions     chatIntentOptions = chatIntentBuilder.With(userAlias);

            if (callCapabilities.Contains(BandyerSdkForms.ChatWithCallCapability.AudioOnly))
            {
                chatIntentOptions.WithAudioCallCapability(capabilities, options); // optional
            }
            if (callCapabilities.Contains(BandyerSdkForms.ChatWithCallCapability.AudioUpgradable))
            {
                chatIntentOptions.WithAudioUpgradableCallCapability(capabilities, options); // optionally upgradable to audio video call
            }
            if (callCapabilities.Contains(BandyerSdkForms.ChatWithCallCapability.AudioVideo))
            {
                chatIntentOptions.WithAudioVideoCallCapability(capabilities, options); // optional
            }
            BandyerIntent bandyerChatIntent = chatIntentOptions.Build();

            MainActivity.StartActivity(bandyerChatIntent);
        }
コード例 #2
0
        void startCallFromJoinUrl(string joinUrl)
        {
            CallCapabilities capabilities = new CallCapabilities();

            capabilities.WithWhiteboard();
            capabilities.WithFileSharing();
            capabilities.WithChat();
            capabilities.WithScreenSharing();

            CallOptions options = new CallOptions();

            //options.WithRecordingEnabled(); // if the call started should be recorded
            //options.WithBackCameraAsDefault(); // if the call should start with back camera
            //options.WithProximitySensorDisabled(); // if the proximity sensor should be disabled during calls

            BandyerIntent.Builder builder           = new BandyerIntent.Builder();
            CallIntentOptions     callIntentOptions = builder.StartFromJoinCallUrl(MainActivity.Application, joinUrl);

            callIntentOptions.WithCapabilities(capabilities); // optional
            callIntentOptions.WithOptions(options);           // optional
            BandyerIntent bandyerCallIntent = callIntentOptions.Build();

            MainActivity.StartActivity(bandyerCallIntent);
        }