Retrieving Bookmarks in Smart Client Plug-in

Hi

I would like to retrieve bookmarks using a Smart Client (Xprotect Corporate 2017R3) plug-in application. Using

VideoOS.Platform.Data.BookmarkService.Instance.BookmarkSearchTime always return empty list every time.

if I call BookmarkService.Instance.BookmarkSearchTime from a standalone app using MIPSDK, it returned my bookmarks.

I tried to access MIPSDK from the plug-in but returned error messages after calling (VideoOS.Platform.SDK.Environment.Login(uri)) and Smart Client got crashed.

In the plugin, I used this code to got bookmarks:

 
 
var currentUniversalTime = utcStartTime;
 int segmentSearchInHours = 6;
 long OneMinuteMicrosecondsFactor = 60000000; //How many microsecond in 1 minute? The answer is 60,000,000.
 
long periodInMinutes = segmentSearchInHours * 60;
long periodInMicroseconds = OneMinuteMicrosecondsFactor * periodInMinutes;
 
while (!stop && currentUniversalTime.AddMinutes(periodInMinutes) <= utcEndTime)
{
   var bookmarks = VideoOS.Platform.Data.BookmarkService.Instance.BookmarkSearchTime(
		item.FQID.ServerId,
		currentUniversalTime,
		periodInMicroseconds,
		int.MaxValue,
		null,
	 	null,
		null,
		null);
 
   currentUniversalTime = currentUniversalTime.AddMinutes(periodInMinutes);
}

I can see all bookmarks using Smart Client search.

Thanks for any help.

Fixed, No need to convert start time to Universal time.

Note: We use universal time internally, but convert from local time to universal where we can. But if DateTime has a DateTimeKind of ‘Unspecified’ the conversion may not work correctly.

Also: You value for one minute is not correct, should be: 60*1000*10000 :slight_smile:

so you mean 1 min = 600,000,000 Microseconds (µs)

but I verified by other websites like http://www.kylesconverter.com/time/minutes-to-microseconds

it is 60,000,000 Microseconds (µs)

Can you verify please ?

yes, but a tick is not a micro second, but 10 microseconds.

arhh 1/10 of a microsecond ofcause

Thanks, I will repeat my test.