This topic has not yet been rated - Rate this topic

How to: Pin or Unpin the Video Stream of a Meeting Participant

[This is preliminary documentation and is subject to change.]

Describes how to pin or unpin the video stream of a meeting participant in a Microsoft Lync 2013 Preview conversation video window.

Before running the code in this topic, an audio/video meeting with three or more participants must be active and you have obtained a Microsoft.Lync.Model.Conversation.Participant object for the participant to pin or un pin. The Participant object is obtained from the meeting Conversation.Participants collection. For information about starting an audio/video conversation, see How to: Start a Video Conversation

The following prerequisites must be met before pinning a participant video stream. These prerequisites are:

Tip Tip

A person can accept a video meeting invitation without having a connected webcam. In this case, the person participates in the meeting by using the IM modality. If the person has a webcam, they can accept the video meeting invitation and choose to participate via IM by declining to turn on their webcam.

A participant’s video stream can be pinned by other participants as long as the prerequisites are met. It is not necessary for a participant to turn on their webcam in order to be pinned to other participant’s meeting video gallery. In this case, the pinned user is represented in the gallery by a blank square. When the pinned participant turns on their webcam, the blank square is replaced with a live video stream from the pinned participant.

Code example

The following example verifies that the two prerequisites to pinning video have been met.

            //Return to caller if local signed in user is not a conversation presenter.
            if (conversation.State != ConversationState.Active)
            {
                Console.WriteLine("Conversation is not active");
            }
            if (conversation.Participants.Count < 3)
            {
                Console.WriteLine("Conversation is not a meeting");
            }
            //Return to caller if the selected conversation participant has not connected the video modality
            if (((Modality)participant.Modalities[ModalityTypes.AudioVideo]).State != ModalityState.Connected)
            {
                Console.WriteLine("Participant has not joined audio/video");
            }

Code example

The following example pins a participant’s video stream if it is not pinned and unpins the video stream if it is pinned.

        /// <summary>
        /// Pins the video stream of a participant in a conversation if the paricipant's video
        /// is not pinned. Otherwise, the video is unpinned
        /// </summary>
        /// <param name="conversation"></param>
        /// <param name="participant"></param>
        private void PinVideoStream(Conversation conversation, Participant participant)
        {

            //Return to caller if local signed in user is not a conversation presenter.
            if (conversation.State != ConversationState.Active)
            {
                return;
            }
            if (conversation.Participants.Count < 3)
            {
                return;
            }
            //Return to caller if the selected conversation participant has not connected the video modality
            if (((Modality)participant.Modalities[ModalityTypes.AudioVideo]).State != ModalityState.Connected)
            {
                return;
            }

            if ((bool)participant.Properties[ParticipantProperty.IsPinned] == false)
            {
                  if (participant.CanInvoke(ParticipantAction.Pin))
                  {
                    participant.BeginPinVideo((ar) =>
                    {
                        participant.EndPinVideo(ar);
                    }
                    , null);
                  }
            }
            else
            {
                if (participant.CanInvoke(ParticipantAction.Pin)
                {
                    participant.BeginUnPinVideo((ar) =>
                    {
                        participant.EndUnPinVideo(ar);
                    }
                    , null);
                }
            }
        }

Community Additions

Show:
© 2014 Microsoft. All rights reserved.