Hello,
I am using Visual studio 2022, .Net Framework 4.8.
and “MilestoneSystems.VideoOS.Mobile.SDK” version 23.2.1 SDK.
I am getting “NotAllowedInThisState” error when try “Create Bookmark”.
I tried Bookmark with Smart Client 32 bit, it is working.
Create bookmark code:
private void tsmiBookmark_Click(object sender, EventArgs e)
{
var bookmarkParams = new BookmarkParams()
{
VideoId = _liveVideo.StreamId,
Name = "Test Bookmark",
Description = "none",
Time = DateTime.Now.ToUniversalTime(),
//StartTime = DateTime.Now.ToUniversalTime(),
CameraId = _liveVideo.StreamParams.CameraId
};
Console.WriteLine($"Video Id: {_liveVideo.StreamId}");
Console.WriteLine($"Camera Id: {bookmarkParams.CameraId}");
var response = Connection.Bookmarks.CreateBookmark(bookmarkParams, _timeout);
Clipboard.SetText(bookmarkParams.VideoId.ToString());
Debug.WriteLine($"Video Id copied to clipborard: {bookmarkParams.VideoId.ToString()}");
Debug.WriteLine("--------------------------------------");
if (response.Result == Command.CommandResultTypes.ResultOk)
{
Console.WriteLine($@"Bookmark success: {response.Result}");
}
else
{
Console.WriteLine($@"Bookmark failed: {response.Result} ->{response.CommandResult}-> {response.ErrorCode}-> {response.ErrorMessage}");
}
}
My Full source code:
I am using LiveSample project in this solution
https://drive.google.com/file/d/1s0FiTsQoqTWs2NQJAY1WQwKQxiGm_3mH/view
My screen record:
https://drive.google.com/file/d/1GrehEb0RUuXDoEeSDZeIIUzHELa3Uhka/view
Thanks in advance
On the video I notice you’re using version XProtect Proffessional+ 2020 R3.