Hi,
I added this namespace:
xmlns:platformclient="clr-namespace:VideoOS.Platform.Client;assembly=VideoOS.Platform"
and place that in my Grid:
<platformclient:PlaybackWpfUserControl Foreground="White" Margin="0,5,0,0" x:Name="_playbackUserControl" />
and I got an exception (attached file).
The ImageViewer which is in the same namespace work without any troubles.
There is no additional code in code behind or viewmodel regarding the playbackControl.
Any ideas?
Best regards
Please tell; what product and version is the XProtect VMS server?
Are you using MIP SDK 2019R2?
Do you see the same error if you use the PlaybackWpfUser sample (unmodified)?
Have you copied the dependent files from the MIP SDK bin? - https://developer.milestonesys.com/s/article/Dependent-files-in-MIP-SDK
I’m currently using as VMS Server 2018 R1 in combination with the 2019 R2 SDK and the sample project is working correct.
I have extended the sample with additional functionality which also worked. But if I create a new Solution with copying all resources (also copying the whole resources from the debug folder to the new debug folder) from the sample I got that exception. The CopyUIFiles.bat way in postbuild events has the same result.
I now created a new empty project and added only the minimum requirements to display the playbackcontrol and it works. So far so good.
But in my current product solution it is still not working.
In my current product solution I use MEF. The plugin where I’ve hosted your components lives in the plugin folder in the client directory. On application start, the “VideoViewer.dll” Plugin will be loaded dynamically in a docking panel.
Best regards!
I found a reason for the excecption.
In your UpdateUiDateTime Method you have lines like this:
_ticksPerPixel = (_endTime.Ticks - _startTime.Ticks) / (int)base.ActualWidth;
In my case the Loaded event of the view fires before the view is visible and so the ActualWidth Property is 0. This also happens when your playbackcontrol is in a Grid which is Collapsed.
So for a workaround I placed a ContentPresenter in my view where I host the PlaybackControl after the view is fully loaded. So in that case I have to instantiate the control in the Codebehind file and fake it’s “ActualWidth” like that:
FrameworkElement par = (FrameworkElement)VisualTreeHelper.GetParent(playbackUserControlPresenter);
if (this.ActualWidth > 0)
{
_playbackUserControl = new PlaybackWpfUserControl();
_playbackUserControl.ShowTallUserControl = true;
_playbackUserControl.ShowSpeedControl = true;
_playbackUserControl.ShowTimeSpanControl = true;
_playbackUserControl.Init(_playbackFQID);
_playbackUserControl.Measure(new Size(par.ActualWidth, 100));
playbackUserControlPresenter.Measure(new Size(par.ActualWidth, 100));
playbackUserControlPresenter.Content = _playbackUserControl;
}
I wanted to see if corrections to the Milestone samples should be made. I found no sample with a UpdateUiDateTime method. If there is a Milestone sample that leads to the errors you saw can you please let me know which sample?
Hi
The UpdateUIDateTime Method lives in VideoOS.Platform.dll in the VideoOS.Platform.Client.PlaybackWpfUserControlMini
Namespace.
Best regards!
Dietmar
Hi Guys,
Has there been a fix to this issue? My WPF app is using databinding that’s being called in a WPF content control. As highlighted by Dietmar, once the user control that’s displaying the video is hidden, I also get the same exception. Will this be resolved?
thank you,
Randeep