MetadataSupplier, live/playback switch

I’m creating a custom overlay based on the AnalyticsOverlay sample. I’ve successfully created a live/playback overlay with the MetadataSupplier and NewImageViewerControlEvent.

MetadataSupplier metadataSupplier = new MetadataSupplier(relatedMetadata, imageViewerAddOn.WindowInformation);

However, when the user changes to playback, the MetadataSupplier_NewMetadataEvent keeps firing as if it still was in live mode. What’s the best approach here to switch over to playback?

While working in the Live and Playback workspaces the MetadataSupplier will be optimal for you. While working elsewhere, in the Search workspace or other places, the MetadataSupplier will not work correctly as it will not have the correct understanding of whether live or playback mode is applicable.

Outside of the Live and Playback workspaces, please stop listening to live events and switch to reading the metadata in playback mode. Metadata Playback Viewer sample can show you how to read the data. See this sample - https://doc.developer.milestonesys.com/html/index.html?base=samples/metadataplaybackviewer.html&tree=tree_search.html?search=metadata+playback+viewe

Note: Smart Client overlay sample was updated. Now it is capable of working in Live mode and playback mode, the sample uses analytic events not metadata but might still be interesting for you as inspiration. - https://doc.developer.milestonesys.com/html/index.html?base=samples/scoverlaygraphonevent.html&tree=tree_search.html?search=the+smart+client+overlay+graph+on+event+plugin

( The Smart Client Overlay Graph on Event plugin sample will in playback mode read analytics events from the server and will display overlay objects from the events as they fit in time. This is an improvement as the sample previously only worked in live mode. Quote from - https://doc.developer.milestonesys.com/html/index.html?base=gettingstarted/mip2019r1_intro.html&tree=tree_home.html )

Are you suggesting that I should stop using the MetadataSupplier altogether and only use the MetadataPlaybackSource even though it’s in live mode? What is the fastest way to retrive and process metadata?

While working in the Live and Playback workspaces the MetadataSupplier will be optimal for you. While working elsewhere, in the Search workspace or other places, the MetadataSupplier will not work correctly as it will not have the correct understanding of whether live or playback mode is applicable.