WPF: How to detect and avoid black “Connected to camera” and “Before/After recordings” screens in ImageViewerWpfControl

Hello everyone!

In my WPF application, I use multiple VideoOS.Platform.Client.ImageViewerWpfControl instances on a single view to display and control video playback. I have a couple of questions about how to handle certain visual states of the control.

1. Black screen with “Connected to camera” text

When I create an ImageViewerWpfControl and display it for the first time, or when I switch its mode between ClientLive and ClientPlayback using the following code:

var message = new VideoOS.Platform.Messaging.Message(
    VideoOS.Platform.Messaging.MessageId.System.ModeChangeCommand,
    Mode.ClientPlayback /* or Mode.ClientLive */
);
EnvironmentManager.Instance.SendMessage(message, _playbackControlFQID); 

…I briefly see a black screen with the text “Connected to camera” before the video appears. The same happens when I first call imageViewer.StartBrowse() and then switch to ClientLive mode — again, a short black screen appears with the same text.

Question:

Is there any way to avoid showing this black screen or detect when the video stream is actually ready and displaying frames (not the “Connected to camera” overlay)?

Are there any events, statuses, or internal states I can use to know when the control is fully initialized and showing video?

(see screenshot 1 — “Connected to camera” overlay)

2. Gray screen with “Before recordings” / “After recordings” text

When the ImageViewerWpfControl is in ClientPlayback mode and I seek to a time when no recording exists, the control shows the last displayed frame, but it turns gray and displays text like “Before recordings” or “After recordings”.

Question:

Is there a way to programmatically detect when the control enters this state?

I would like to display my own overlay or layout instead of the gray frame with text.

(see screenshot 2 — “Before recordings” state)

These texts are governed by -

VideoOS.Platform.Client.ImageViewerWpfControl.ConfigureOverlayText

VideoOS.Platform.Client.ImageViewerWpfControl.ConfigureOverlayTextAndImage

Ref. https://doc.developer.milestonesys.com/mipsdk/index.html?base=MIPhelp%2Fclass_video_o_s_1_1_platform_1_1_client_1_1_image_viewer_wpf_control.html&tree=tree_Search.html

Unfortunately there are no samples or extended documentation on the details of using these methods.

I have an idea that the ImageDisplayed, LiveStreamInformationReceived,

RecordedImageReceived events might give some information, but there is no event that directly signals the overlay is being used.

It is a conscious design, you see it also in the Smart Client, in the camera view items, that these overlays are used as a visual information upon the state of the images being streamed, so maybe it is not simple to replace this behavior with something else.