I would like to play the video an hour ago, and I use the following code to operate. But I found the player only showed the picture an hour ago for a very short time, and then continued to play the video at the current time. I am sure it was the playback mode, because it could play at the reverse mode, only the play time could be changed. Can any one help me?
EnvironmentManager.Instance.SendMessage(new VideoOS.Platform.Messaging.Message(MessageId.SmartClient.PlaybackCommand,
new PlaybackCommandData()
{
Command = PlaybackData.Goto,
DateTime = dateTime
}),
fqid);
EnvironmentManager.Instance.SendMessage(new VideoOS.Platform.Messaging.Message(
MessageId.SmartClient.PlaybackCommand,
new PlaybackCommandData() { Command = PlaybackData.PlayForward, Speed = 1.0 }), fqid);
The following is the initialization of the player:
string cameraFQID = “DD0C4284-DB24-447B-9DB5-05DE64C504AF”;
Item cameraItem = Configuration.Instance.GetItem(new Guid(cameraFQID), Kind.Camera);
\_playbackControllerFQID = ClientControl.Instance.GeneratePlaybackController();
\_imageViewerControl1 = ClientControl.Instance.GenerateImageViewerControl();
\_imageViewerControl1.PlaybackControllerFQID = \_playbackControllerFQID;
\_imageViewerControl1.Dock = DockStyle.Fill;
pictureBox1.Controls.Clear();
pictureBox1.Controls.Add(\_imageViewerControl1);
\_imageViewerControl1.CameraFQID = cameraItem.FQID;
\_imageViewerControl1.Initialize();
\_imageViewerControl1.Connect();
If you look at the PlaybackUser sample (or PlaybackUserWpf sample) does the goto time implementation there work for you? (Sample source could then be compared to yours.)
One idea; using the DateTime you can have either local time or UTC time, if misunderstood you will either get wrong data or nothing. A test could be to use DateTime…ToUTC(). Working with this make sure your client PC and the XProtect server is correctly setup, correct time and time zone etc.
I found GOTO only worked for the first time, but when I changed the play time by GOTO. The correct image only displayed for a very short time, and then continued to play at the previous time.
private DateTime dateTime = DateTime.Now.AddDays(-1);
public void changeTime(FQID fqid)
{
if (fqid == null) return;
dateTime = dateTime.AddMinutes(-30);
Console.WriteLine("dateTime: " + dateTime);
EnvironmentManager.Instance.SendMessage(new VideoOS.Platform.Messaging.Message(MessageId.SmartClient.PlaybackCommand,
new PlaybackCommandData()
{
Command = PlaybackData.Goto,
DateTime = dateTime
}),
fqid);
EnvironmentManager.Instance.SendMessage(new VideoOS.Platform.Messaging.Message(
MessageId.SmartClient.PlaybackCommand,
new PlaybackCommandData() { Command = PlaybackData.PlayForward, Speed = 1.0 }), fqid);
}
Thank you very much. I found the issue was exactly the one you said. I am using SDK 2014SP3. The latest SDK is a 64-bit software, but I have to integrate some 32-bit DLLs to our application. Can I download a 32-bit SDK?