Example #1
0
        public async System.Threading.Tasks.Task UploadRecordedResponse(string Description)
        {
            try
            {
                this.RunOnUiThread(() => LoadingView.Show(this, "Uploading..."));
                var binaryData = VideoManager.GetVideoData();
                if (VideoManager.IsRecorderStop && binaryData != null)
                {
                    string msg = string.Empty;
                    if (UserResponseType == UserResponse.Video)
                    {
                        msg = await UserResponseAPI.UploadUserResponse(videoId, binaryData, InputSelectedType.Recorded, Description);
                    }
                    else
                    {
                        msg = await UserResponseAPI.UploadAudioUserResponse(videoId, binaryData, InputSelectedType.Recorded, Description);
                    }
                    if (ResponseFragment != null)
                    {
                        await ResponseFragment.GetResponseList(videoId);

                        ResponseFragment.GetUserResponse(videoId);
                    }
                    if (msg.Contains("ok"))
                    {
                        this.RunOnUiThread(() => Toast.MakeText(this, "Response Uploaded successfully", ToastLength.Short).Show());
                    }
                    else
                    {
                        this.RunOnUiThread(() => Toast.MakeText(this, msg, ToastLength.Short).Show());
                    }
                }
            }
            catch (System.Exception ex)
            {
            }
            finally
            {
                this.RunOnUiThread(() => LoadingView.Hide());
            }
        }