switch from live to playback and vice versa in plugin smartclient using imageviewcontrol

Hi everyone!

I am developing a plugin to live video from imageserver. I want to custom toolbar to switch between live and playback mode. because I want to add some function to display video, I develop a plugin. I have a problem how to switch live mode and playback mode. I reference some sample about component integration such as: video viewer and video viewer indivisual playback but in plugin enviroment don’t support EnvironmentManager.Instance.Mode. I don’t know how to switch mode.

can anyone help me?

Thank in advance!

In the Smart Client this is different to the standalone as Live and Playback modes are controlled by the workspace (or tab) in the Smart Client.

You should use Sendmessage -ShowWorkSpaceCommand -you can see thiis used in the SCWorkSpace sample.

You will also need..

-

Guid VideoOS.Platform.ClientControl.LiveBuildInWorkSpaceId = new Guid(“B8C936BF-815D-4D5D-BAAF-1CEAFC7428C0”) [static]

Guid defining the object id of the build in live work space item.

Guid VideoOS.Platform.ClientControl.PlaybackBuildInWorkSpaceId = new Guid(“DA486915-863C-4ECE-B301-5FC7FD80A2B0”) [static]

Guid defining the object id of the build in playback work space item.

Hi Bo,

I reference SCWorkSpace sample. this sample allow user switch “LIVE” tab to “Playback” tab…In my application I want to switch from live mode to playback mode in same “LIVE” tab. it operates as “independent playback” function of Xprotect smart client. Can you give me ideal? if using component integration, I have a solution.

Thank you so much!

I believe the Smart Client Independent Playback plugin sample shows you what you need to do in that scenario. If that sample does not fit what you want to do then please explain further.

Hi Bo,

I reference that sample. I wonder how to control “image viewer control” in LIVE mode or playback. it has property to setting mode.

Thank you so much

I reference videopreview and independent playback plugin. a sample for live mode, the other one for playback mode. but I don’t find how to set mode.

We changed the Independent Playback sample, I think this will be the best way to show you. Add this method..

void _imageViewerControl_RightClickEvent(object sender, EventArgs e)
        {
            if (_playbackUserControl.Enabled)
            {
                _playbackUserControl.SetEnabled(false);
                _playbackUserControl.Enabled = false;
                _playbackUserControl.Hide();
                _imageViewerControl.StartLive();
            }
            else
            {
                _playbackUserControl.SetEnabled(true);
                _playbackUserControl.Enabled = true;
                _playbackUserControl.Show();
                _imageViewerControl.StartBrowse();                
            }
        }

Inside the SetUpApplocationEventListeners():

Add:

_imageViewerControl.RightClickEvent += _imageViewerControl_RightClickEvent;

And the similar -= in the RemoveApplicationEventListeners()

Now, with this change, the sample will work so that if you right-click in the image you will switch from live to playback and vice versa.