// Use this for initialization
        void Start()
        {
            exampleTitle      = "[NatCorderWithOpenCVForUnity Example] (" + NatCorderWithOpenCVForUnityExample.GetNatCorderVersion() + ")";
            exampleSceneTitle = "- Video Recording Example";

            fpsMonitor = GetComponent <FpsMonitor>();

            webCamTextureToMatHelper = gameObject.GetComponent <WebCamTextureToMatHelper>();
            int width, height;

            Dimensions(requestedResolution, out width, out height);
            webCamTextureToMatHelper.requestedWidth  = width;
            webCamTextureToMatHelper.requestedHeight = height;

#if UNITY_ANDROID && !UNITY_EDITOR
            // Avoids the front camera low light issue that occurs in only some Android devices (e.g. Google Pixel, Pixel2).
            webCamTextureToMatHelper.avoidAndroidFrontCameraLowLightIssue = true;
#endif
            webCamTextureToMatHelper.Initialize();


            microphoneSource = gameObject.AddComponent <AudioSource>();
            videoPlayer      = gameObject.AddComponent <VideoPlayer>();


            comicFilter = new ComicFilter();

            // Update GUI state
            requestedResolutionDropdown.value = (int)requestedResolution;
            containerDropdown.value           = (int)container;
            videoBitRateDropdown.value        = Array.IndexOf(System.Enum.GetNames(typeof(VideoBitRatePreset)), videoBitRate.ToString());
            audioBitRateDropdown.value        = Array.IndexOf(System.Enum.GetNames(typeof(AudioBitRatePreset)), audioBitRate.ToString());
            applyComicFilterToggle.isOn       = applyComicFilter;
            recordMicrophoneAudioToggle.isOn  = recordMicrophoneAudio;
        }
        /// <summary>
        /// Raises the share button click event.
        /// </summary>
        public async void OnShareButtonClick()
        {
            Debug.Log("OnShareButtonClick ()");

            if (isVideoPlaying || isVideoRecording || isFinishWriting || string.IsNullOrEmpty(videoPath))
            {
                return;
            }

            var mes = "";

#if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR
            try
            {
                SharePayload payload = new SharePayload();
                payload.AddText("User shared video! [NatCorderWithOpenCVForUnity Example](" + NatCorderWithOpenCVForUnityExample.GetNatCorderVersion() + ")");
                payload.AddMedia(videoPath);
                var success = await payload.Commit();

                mes = $"Successfully shared items: {success}";
            }
            catch (ApplicationException e)
            {
                mes = e.Message;
            }
#else
            mes = "NatShare Error: SharePayload is not supported on this platform.";
            await Task.Delay(100);
#endif

            Debug.Log(mes);
            if (fpsMonitor != null)
            {
                fpsMonitor.Toast(mes);
            }
        }