示例#1
0
        /// <summary>
        /// Called when the call changes its state to paused or resumed.
        /// </summary>
        public void PauseStateChanged(LinphoneCall call, bool isCallPaused, bool isCallPausedByRemote)
        {
            buttons.pause.IsChecked           = isCallPaused || isCallPausedByRemote;
            buttons_landscape.pause.IsChecked = isCallPaused || isCallPausedByRemote;
            buttons.pauseImg.Source           = new BitmapImage(new Uri(isCallPaused || isCallPausedByRemote ? pauseOn : pauseOff, UriKind.RelativeOrAbsolute));
            buttons_landscape.pauseImg.Source = new BitmapImage(new Uri(isCallPaused || isCallPausedByRemote ? pauseOn : pauseOff, UriKind.RelativeOrAbsolute));

            if (!isCallPaused && !isCallPausedByRemote)
            {
                if (call.GetCurrentParamsCopy().VideoEnabled&& !((InCallModel)ViewModel).IsVideoActive)
                {
                    // Show video if it was not shown yet
                    ((InCallModel)ViewModel).IsVideoActive = true;
                    buttons.video.IsChecked           = true;
                    buttons_landscape.video.IsChecked = true;
                    buttons.videoImg.Source           = new BitmapImage(new Uri(videoOn, UriKind.RelativeOrAbsolute));
                    buttons_landscape.videoImg.Source = new BitmapImage(new Uri(videoOn, UriKind.RelativeOrAbsolute));
                    ButtonsFadeInVideoAnimation.Begin();
                    StartFadeTimer();
                }
                else if (!call.GetCurrentParamsCopy().VideoEnabled&& ((InCallModel)ViewModel).IsVideoActive)
                {
                    // Stop video if it is no longer active
                    ((InCallModel)ViewModel).IsVideoActive = false;
                    buttons.video.IsChecked           = false;
                    buttons_landscape.video.IsChecked = false;
                    buttons.videoImg.Source           = new BitmapImage(new Uri(videoOff, UriKind.RelativeOrAbsolute));
                    buttons_landscape.videoImg.Source = new BitmapImage(new Uri(videoOff, UriKind.RelativeOrAbsolute));
                    ButtonsFadeInAudioAnimation.Begin();
                    StopFadeTimer();
                }
                if (((InCallModel)ViewModel).IsVideoActive)
                {
                    ButtonsFadeOutAnimation.Begin();
                }
            }
            else
            {
                ((InCallModel)ViewModel).IsVideoActive = false;
                ((InCallModel)ViewModel).ShowButtonsAndPanel();
                ButtonsFadeInAudioAnimation.Begin();
                StopFadeTimer();
            }
        }