Issue while calling PlaybackData.Goto commad in VideoPlayback on Secondary displays.

Hi,

I am using Multiwindow and trying to display recorded video for specific DateTime on multiple displays based on window FQID.

Using “ChangeModeCommand” to change mode (Playback).

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

       MessageId.SmartClient.ChangeModeCommand)

    { Data = Mode.ClientPlayback }, windows\[wIndex\].FQID));

If video is going to play on Main window then assining null to WindowFQID and using SelectWindow command.

if (windows[wIndex].FQID.ObjectId == windows[wIndex].FQID.Kind)

  {

    //Make sure the Main window is in focus(selected), otherwise the playback wont start ?????

    MultiWindowCommandData data = new MultiWindowCommandData();

    data.MultiWindowCommand = MultiWindowCommand.SelectWindow;

    data.Window = null;

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

      MessageId.SmartClient.MultiWindowCommand, data), null, null));

    windows\[wIndex\].FQID = null;

  }

If it is not Main window, It should display recorded video from specified time based on WindowFQID.

PlaybackCommandData pcdGT = new PlaybackCommandData() { Command = PlaybackData.Goto, DateTime = integralST };

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

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

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

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

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

Recorded video is playing on Main window for specified datetime but other displays (secondary display) are just changing to playback mode and not palying video for specified datetime.

I am using Xprotect Smart Client 2023 R3 version. It was working fine in 2022 R3 version.

Regards,

Priyanka

Can you make a minimal implementation plugin that shows the issue and send me the source code? It would ensure that I can test and debug here at the Milestone test lab with no chance that I misinterpret your words or codes.

Hi,

Here am attaching the minimal implementation plugin.

This SMART Client plugin runs as a background plugin and listens for a User Defined Event “PlaybackInAllWindows”.

When the event is received it will start playback in all windows at “2024-01-19 08:00:00”.

The playback in the Main Window is delayed 5s, just for debug purposes.

Start the SMART Client open a couple of windows then send the UDE “PlaybackInAllWindows”.

In SMART Client 2022R1 and 2022 R3 Playback starts in all windows but in 2023 R3 it only starts in the main window.

Let me know if you need any information.

I have downloaded, built and run your plugin in the way you describe. I can confirm that I observe the same as you, and also that the behavior is different in Smart Client 2023R3 compared to 2023R2.

Next step I will get Milestone Development to analyse the issue.

Thank you for making the minimal implementation plugin, it makes it clear what the issue is and easy for us at Milestone to see.

Investigations shows that this is not a bug in the Smart Client but wrong usages of the messages in the plugin. The plugin code uses the MIP messages

MessageId.SmartClient.ChangeModeCommand

MessageId.SmartClient.PlaybackCommand

And passes the FQIO of a windows item as destination in the SendMessage call. This does not work since ChangeModeCommand and PlaybackCommand expects that the destination is an FQID of a PlaybackController.

The reason that it “by accident” worked in earlier versions of the Smart Client is that before multiple view tabs per window was introduced in 2023, the FQID of the windows was set to the FQID of the view’s playback controller. Since Smart Client windows now can hold multiple views that is no longer the case.

This is all by design and the MIP documentation for ChangeModeCommand and PlaybackCommand has always specified that the destination FQID should be from a playback controller.

Hi,

Thank you for the response. I tried with PlaybackControllerFQID, it worked well. I have used “NewImageViewerControlHandler” to fetch the Playback controllerFQID. Here is that code

ClientControl.Instance.NewImageViewerControlEvent += new ClientControl.NewImageViewerControlHandler(NewImageViewerPlaybackControlEvent);

private void NewImageViewerPlaybackControlEvent(ImageViewerAddOn imageViewerAddOn)

{

  PlaybackCommandData pcdGT = new PlaybackCommandData() { Command = PlaybackData.Goto, DateTime = integralStartTime };

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

WindowInformation _windowInformation = imageViewerAddOn.WindowInformation;

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

    new VideoOS.Platform.Messaging.Message(MessageId.SmartClient.PlaybackCommand, pcdGT), ClientControl.Instance.GetPlaybackController(\_windowInformation)));

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

    new VideoOS.Platform.Messaging.Message(MessageId.SmartClient.PlaybackCommand, pcdPF), ClientControl.Instance.GetPlaybackController(\_windowInformation)));

}

Do you have any suggestions for finiding PlaybackControllerFQID on MultiWindow rather than “NewImageViewerControlEvent” ?

Thanks in advance!

Unfortunately my answer is no. I am guessing or hoping it is possible to keep track of the ImageViewers that open and then on the right one do the necessary.