Hi,
First post here and sort of new to Milestone. 
When i click in the gui on the PlaybackUserControl and catch the “message.Data” it is the type of PlaybackCommandData. I guess thats correct. But in the documentation it says: “.Command: Refers to one of the commands in PlaybackData class”. Thats correct if i only press play or reverse. If i click on any other button in the PlaybackUserControl(nextframe, prevframe etc) it returns “PlayStop”. Why is that? I think ive tried every single typecast possible and tried to copy some code from the samples but it wont work.
Anyone have a solution or explanation to this?
var commandData = message.Data as PlaybackCommandData; //Have tried with “as PlaybackData”, returns null.
commandData.Command; //Only returns: PlayForward/PlayReverse/PlayStop.
PlaybackCommandData is send to instruct the PlaybackController of what to do. The PlaybackCommandData.Command is = one of the constants defined in PlaybackData class.
How did you implement the “catch of message” mentioned above?
Usually you register a receiver, and define what message to receive, and from who you like to receive information.
If you like to understand what the user clicks, receive the PlaybackCommandIndication message.
Yea, the PlaybackCommandData.Command should be an inner class of PlaybackData attributes if i understand it correctly. But it feels like PlayStop is some kind of default that for some reason gets returned when i press nextframe, etc.
Reg:
_objRef2 = EnvironmentManager.Instance.RegisterReceiver(PlaybackCommandHandler,
new PlaybackControllerFilter(MessageId.SmartClient.PlaybackIndication, \_playbackFQID));
Catch:
private object PlaybackCommandHandler(Message message, FQID dest, FQID sender)
{
var commandData = message.Data as PlaybackCommandData;
if (commandData != null)
{
switch (commandData.Command)
{
case PlaybackData.Begin:
//etc…
Thx, for fast answer 
You get the PlaybackData.PlayStop because the PlaybackUserControl are sending this command as you press something. The PlaybackController then received this message and handle the action - it will inturn send out information about commands or current time of what should be displayed. Most of the time you just get the TimeChangedIndication, and should follow that.
Lets see if i understand this correctly.
PlaybackCommandData.Command can only return PlayForward, PlayReverse and defaults to PlayStop while other buttons are pressed?
About that it send out a message to TimeChangeIndication i doubt at the moment. I rewrote my code a bit so it just ignore the PlaybackCommandData.Command. Instead i only call:
bitmapVideoSource.GetNearest(*time caught from TimeChangeIndication*) as BitmapData;
This wont work after i press the other buttons due to they send PlayStop which pause the time in the PlaybackUserControl.
I feel like there needs to be a way for me to validate if the user actually press stop or nextframe/prev-sequence, but they all return the same value.
The PlaybackUserControl is intended to work together with one of our viewing components, and as a result you get a timestamp. The reason being that when the user presses Next-Frame or Next-Sequence - you should not be handling this, the viewing component will calculate / lookup what the command should result in.
All our implementations use this method.
When one selected viewing of a camera controls the next/previous timestamp, all other viewing components using the same playback controller should then follow the timestamp, so the entire display to the user then represent data from the same time.
Also, try registering for the “PlaybackCommand” as well - and se if the messages will contain what you are looking for.
Have tried registrering message for “PlaybackCommand” and it returns the same.
Oh, so i actually need “ImageViewerControl” class. Thought i saw some examples not using it, and i try to keep the code clean of unnecessary stuff. Think it were RGBVideoEnhancement not using it for example. But i will try to add it and hope it will work .
Thanks for the help! 