How to display Playback video on Smart client Main window by using PlugIn?

I am using PlaybackCommand to display recorded video on mutiple windows.

DateTime date2 = new DateTime(2022, 06, 20, 11, 30, 50);

  PlaybackCommandData pcdDT = new PlaybackCommandData() { Command = PlaybackData.Goto, DateTime = date2 };

  PlaybackCommandData pcdPF = new PlaybackCommandData() { Command = PlaybackData.PlayForward, Speed = 4 };

ClientControl.Instance.CallOnUiThread(() => EnvironmentManager.Instance.SendMessage(

    new VideoOS.Platform.Messaging.Message(MessageId.SmartClient.PlaybackCommand, pcdDT), windowFQIDList\[wIndex\]));

  ClientControl.Instance.CallOnUiThread(() => EnvironmentManager.Instance.SendMessage(

    new VideoOS.Platform.Messaging.Message(MessageId.SmartClient.PlaybackCommand, pcdPF), windowFQIDList\[wIndex\]));

The recorded video is displaying on Secondary display1 and Secondary display2 from that perticular time.

but its not working on Primary display(Main window).

Is there any way to slove this issue?

And How to add end time for the recorded video?

Thanks in advance.

Main Window is reachable by sending to null.

You do a PlaybackCommand PlaybackData.PlayStop when you reach the end time.

Hi,

Thank you for the response

I am not able to play recorded video from specific time in main window but it is working fine in other windows( primary display and floating window).

How do we know the time information to stop the video?

The Smart Client View and Windows Tool, the Playback Control tab, will show you this operating in the Main window, and it includes the Current Playback Time which can be used to see the time being played and used to know when to stop.

https://developer.milestonesys.com/s/article/Exploring-the-MIP-SDK-Tool-View-and-Window-Tool

https://doc.developer.milestonesys.com/html/index.html?base=samples/pluginsamples/scviewandwindow/readme.html&tree=tree_1.html

Hi Bo Ellegård Andersen,

I have checked View and Window Tool plugin and added to my Smart Client, its working fine. Main window playback video is displaying on particular time.

But when i use same lines of code in my project, its not working on Main window. And its working fine in other windows.

string command = “Goto”;

DateTime date2 = new DateTime(2022, 06, 27, 08, 05, 50);

  date2 = TimeZoneInfo.ConvertTime(date2, ClientControl.Instance.SelectedTimeZoneInfo, TimeZoneInfo.Utc);

  Double speed = 4;

  ClientControl.Instance.CallOnUiThread(() => EnvironmentManager.Instance.SendMessage(

    new VideoOS.Platform.Messaging.Message(

      MessageId.SmartClient.PlaybackCommand,

      new PlaybackCommandData()

      {

        Command = command,

        DateTime = date2,

        Speed = speed

      })));

Here we are not giving any window information but in my case i need to display playback video on specific window.

And also i need to display recorded video for specific interval of time like 2022-06-26 08-00 to 2022-06-26 09-00. Is it possible?

Thanks in Advance.

If the sample works the same code should also work in your plugin, please double-check you do the same as the sample. One idea I have is that this only works if you are in playback mode. I believe the sample also shows you how to switch mode using “SmartClient.ChangeModeCommand”

To display recorded video for a specific interval in time: You switch to playback mode, you goto a specific time where you want playback to start, you start playing forward “PlayStart”, you listen for the time being played back, when you reach the end time you do a “PlayStop”.

When debugging please use these instructions: https://developer.milestonesys.com/s/article/debugging-techniques-for-Smart-Client-plugins

Hi Bo Ellegård Andersen,

I give you clear explanation about my issue

When I write code based on “View and Window Tool” sample plugin

DateTime date2 = new DateTime(2022, 06, 27, 08, 05, 50);

Double speed = 4;

  ClientControl.Instance.CallOnUiThread(() => EnvironmentManager.Instance.PostMessage(new VideoOS.Platform.Messaging.Message(

        MessageId.SmartClient.ChangeModeCommand)

  { Data = Mode.ClientPlayback }, windows.FirstOrDefault().FQID));

  ClientControl.Instance.CallOnUiThread(() => EnvironmentManager.Instance.SendMessage(

    new VideoOS.Platform.Messaging.Message(

      MessageId.SmartClient.PlaybackCommand,

      new PlaybackCommandData()

      {

        Command = "Goto",

        DateTime = date2,

        Speed = speed,

      })));

  command = "PlayForward";

  ClientControl.Instance.CallOnUiThread(() => EnvironmentManager.Instance.SendMessage(

    new VideoOS.Platform.Messaging.Message(

      MessageId.SmartClient.PlaybackCommand,

      new PlaybackCommandData()

      {

        Command = "PlayForward",

        DateTime = date2,

        Speed = speed,

      })));

Main window is changing to Playback mode and displaying recorded video from specific time when I have only one main window. It doesn’t work when I have more windows on multiple screens (Eg: Primary Display 1 and Primary display2).

When I write code based on “Video Viewer - Individual Playback” sample to display back on multiwindow

DateTime date2 = new DateTime(2022, 06, 20, 11, 30, 50);

  PlaybackCommandData pcdDT = new PlaybackCommandData() { Command = PlaybackData.Goto, DateTime = date2 };

  PlaybackCommandData pcdPF = new PlaybackCommandData() { Command = PlaybackData.PlayForward, Speed = 4 };

ClientControl.Instance.CallOnUiThread(() => EnvironmentManager.Instance.PostMessage(new VideoOS.Platform.Messaging.Message(MessageId.SmartClient.ChangeModeCommand) { Data = Mode.ClientPlayback }, windowFQIDList[wIndex]));

   ClientControl.Instance.CallOnUiThread(() => EnvironmentManager.Instance.SendMessage(

      new VideoOS.Platform.Messaging.Message(MessageId.SmartClient.PlaybackCommand, pcdDT), windowFQIDList\[wIndex\]));

    ClientControl.Instance.CallOnUiThread(() => EnvironmentManager.Instance.SendMessage(

     new VideoOS.Platform.Messaging.Message(MessageId.SmartClient.PlaybackCommand, pcdPF), windowFQIDList\[wIndex\]));

   All other windows (primary display1 and floating windows) are displaying playback video from specific time. But when it comes to Main window, It changes to playback mode but it is not displaying playback video from specific time.

Let me know if you any solution for this.