I'm working with TimelineMetadata markers for a while now and it always worked great for me.
In the last few days I'm trying to figure how come a specific marker sometimes not trigering the Marker_Time_Reached event.
What I found out is that sometimes the condition in checkTemporalMetadata function won't work:
|if (||(temporalValueCollection[index].time >= (now - TOLERANCE)) && (temporalValueCollection[index].time <= (now + TOLERANCE))....|
My marker intime is at 227.185 and sometimes the TOLERANCE value is just not enough.
I added traces right before this condition is checked. Here are the logs:
checkTemporalMetadata: currentTime: 226.6750999999997 marker time: 227.185
checkTemporalMetadata: currentTime: 226.8100999999997 marker time: 227.185
checkTemporalMetadata: currentTime: 227.3790999999997 marker time: 227.185
Marker_Time_Reached not sent:
checkTemporalMetadata: currentTime: 226.71479999999968 marker time: 227.185
checkTemporalMetadata: currentTime: 226.8297999999997 marker time: 227.185
checkTemporalMetadata: currentTime: 227.4357999999997 marker time: 227.185
I know I can enlarge TOLERANCE value to a bit more than 0.25 and it will solve the issue, but how can I be sure it will be enough?
Can you tell me what is special about this marker time that will cause it to be left out occasionally? Should I follow any recommendations before adding a timeline marker?
Based on your description only, since I cannot reproduce it, I think the timer is not called at the intervals it should.
My proposed workaround is to identify the real timer interval (between 2 calls) and to use it as an indication for the tolerance. You could make it asymmetrical - (now + 1.5*tollerance) or employ a dynamic tollerance based on the last few times when the function was called.