/// <summary>
        /// Initialize AV frame player.
        /// </summary>
        /// <returns>Task denoting creation of the player with initial frames enqueued.</returns>
        private async Task StartAudioVideoFramePlayerAsync()
        {
            try
            {
                await Task.WhenAll(this.audioSendStatusActive.Task, this.videoSendStatusActive.Task).ConfigureAwait(false);

                this.logger.Info("Send status active for audio and video Creating the audio video player");
                this.audioVideoFramePlayerSettings =
                    new AudioVideoFramePlayerSettings(new AudioSettings(20), new VideoSettings(), 1000);
                this.audioVideoFramePlayer = new AudioVideoFramePlayer(
                    (AudioSocket)this.audioSocket,
                    (VideoSocket)this.mainVideoSocket,
                    this.audioVideoFramePlayerSettings);

                this.logger.Info("created the audio video player");

                this.audioVideoFramePlayer.LowOnFrames += this.OnAudioVideoFramePlayerLowOnFrames;

                // Create AV buffers
                var currentTick = DateTime.Now.Ticks;
                this.CreateAVBuffers(currentTick, replayed: false);

                await this.audioVideoFramePlayer.EnqueueBuffersAsync(this.audioMediaBuffers, this.videoMediaBuffers).ConfigureAwait(false);
            }
            catch (Exception ex)
            {
                this.logger.Error(ex, "Failed to create the audioVideoFramePlayer with exception");
            }
            finally
            {
                this.startVideoPlayerCompleted.TrySetResult(true);
            }
        }
        private async Task StartAudioVideoFramePlayer()
        {
            try
            {
                await Task.WhenAll(_audioSendStatusActive.Task, _videoSendStatusActive.Task);

                Log.Info(
                    new CallerInfo(),
                    LogContext.Media,
                    "Send status active for audio and video Creating the audio video player");

                AudioVideoFramePlayerSettings settings = new AudioVideoFramePlayerSettings(new AudioSettings(20), new VideoSettings(), _mediaBufferToLoadInSeconds * 1000);
                _audioVideoFramePlayer = new AudioVideoFramePlayer(_audioSocket, _videoSocket, settings);

                Log.Info(
                    new CallerInfo(),
                    LogContext.Media,
                    "created the audio video player");

                _downloadManager.ConnectToStorageAccount();
                _audioVideoFramePlayer.LowOnFrames += OnLowOnFrames;
                var currentTick = DateTime.Now.Ticks;
                _videoMediaBuffers = _downloadManager.GetVideoMediaBuffers(currentTick);
                _audioMediaBuffers = _downloadManager.GetAudioMediaBuffers(currentTick);
                //update the tick for next iteration
                _mediaTick = Math.Max(_audioMediaBuffers.Last().Timestamp, _videoMediaBuffers.Last().Timestamp);
                await _audioVideoFramePlayer.EnqueueBuffersAsync(_audioMediaBuffers, _videoMediaBuffers);
            }
            finally
            {
                _startVideoPlayerCompleted.Set();
            }
        }
        /// <summary>
        /// Creates the vbss player that will stream the video buffers for the sharer.
        /// </summary>
        private void CreateVbssFramePlayer()
        {
            try
            {
                this.logger.Info("Creating the vbss FramePlayer");
                this.audioVideoFramePlayerSettings =
                    new AudioVideoFramePlayerSettings(new AudioSettings(20), new VideoSettings(), 1000);
                this.vbssFramePlayer = new AudioVideoFramePlayer(
                    null,
                    (VideoSocket)this.vbssSocket,
                    this.audioVideoFramePlayerSettings);

                this.vbssFramePlayer.LowOnFrames += this.OnVbssPlayerLowOnFrames;
            }
            catch (Exception ex)
            {
                this.logger.Error(ex, $"Failed to create the vbssFramePlayer with exception {ex}");
            }
        }