Unable to add video control

Hello,

I am using ImageViewerControl to view the video into our player page, I am able to add the video and display it. But I am unable to add or even find function like play, pause, forward backward, etc. I was wondering if I really need to add playback control or playback user control. I actually just want the function that perform video action. I have my own buttons and line for video. But I want to integrate these function.

Please help

I tried this way too (it’s in vb.net)

    EnvironmentManager.Instance.SendMessage(New VideoOS.Platform.Messaging.Message(MessageId.SmartClient.PlaybackCommand, New PlaybackCommandData() With {.Command = PlaybackData.PlayStop}), InnerVideoControl.PlayBackFQID)

value comes from

_playbackFQID = ObjInstance.mClientControl.GeneratePlaybackController()

InnerVideoControl.PlaybackControllerFQID = _playbackFQID

If you look at the VideoViewer2playback sample it has two Image Viewers, one is using the default PlaybackController, the other has a specific one.

I have an idea that if you look at the sample and how it has the functions you seek implemented on the buttons, you might see if you have done something wrong by comparing with the sample. What you explain sounds right so I cannot say that you do something wrong, but perhaps comparing to the sample will be a help.

https://doc.developer.milestonesys.com/html/index.html?base=samples/componentsamples/videoviewer2playback/readme.html&tree=tree_2.html

https://github.com/milestonesys

I am seeing one with,

1. ButtonStop1_Click

EnvironmentManager.Instance.SendMessage(new VideoOS.Platform.Messaging.Message(

    MessageId.SmartClient.PlaybackCommand,

    new PlaybackCommandData() { Command = PlaybackData.PlayStop }));

  EnvironmentManager.Instance.Mode = Mode.ClientPlayback;

another with

2.ButtonStop2_Click

  EnvironmentManager.Instance.SendMessage(new VideoOS.Platform.Messaging.Message(

      MessageId.SmartClient.PlaybackCommand,

      new PlaybackCommandData() { Command = PlaybackData.PlayStop }),

    \_playbackControllerFQID);

I believe 1 is the one without playback controller.

I have 2 question regarding the VideoViewer2playback

  • Both function have parameter as (object sender, RoutedEventArgs e)

What is the use of these parameters? I am not seeing any use of it inside the function,

and do I need these parameters?

  • I see initiation of
            EnvironmentManager.Instance.RegisterReceiver(PlaybackTimeChangedHandler, new MessageIdFilter(MessageId.SmartClient.PlaybackCurrentTimeIndication));
            EnvironmentManager.Instance.RegisterReceiver(PlaybackIndicationHandler, new MessageIdFilter(MessageId.SmartClient.PlaybackIndication));

Do I need to do this?

if yes, they call PlaybackTimeChangedHandler and PlaybackIndicationHandler, do I need to implement these function like it is implemented there?

I don’t think there is anything useful in the parameters. You can put a breakpoint and see. When it comes to all the Milestone samples the parameters are never used.

In the sample the PlaybackTimeChangedHandler is used to display the time being played back and the PlaybackIndicationHandler does some special manipulation of the speed. You do not have to implement these.

Sure I will remove these two functions

I have implemented pause like this way, but it always go to after recording, not sure if I am not having right timing for the pause video to work on

I have no idea what your if statement does. If you just do the PlayStop and nothing else doesn’t that playback stop immediately?

I don’t understand why you have the Mode commands, if you have somewhere else that calls Mode.ClientLive so that the mode is changed at the wrong time it could affect the playback experience. Can’t you leave out the Mode.ClientPlayback here?

I have been seeing these two statement everywhere to control the video in the sample codes, (here, VideoViewer2Playback), like to be in playback mode then control the video secondly

Which I kind of changed in vb.net

so do you mean like, just using

PlaybackData.PlayStop

will work? instead of enviroment.instance.sendmessage…

One more question here,

I tried few places

before connecting to the camera

After connecting also

so only place it didn’t go to after recording message was in near the playstop commands, etc

I am able to get the recording working with clientPlayback mode but it goes like after recording (seems like getting the current UTC time)

I am wondering how can I get the last recording

I tried both,

      EnvironmentManager.Instance.SendMessage(New VideoOS.Platform.Messaging.Message(MessageId.SmartClient.PlaybackCommand, New PlaybackCommandData() With {.Command = PlaybackData.NextSequence}))

And

      EnvironmentManager.Instance.SendMessage(New VideoOS.Platform.Messaging.Message(MessageId.SmartClient.PlaybackCommand, New PlaybackCommandData() With {.Command = PlaybackData.Begin}))

but none works

I am worrying that you should only change mode when you need to switch from live to playback or the other way. In the sample there is a button to change mode..

I would expect PlaybackData.Begin to jump to the very first recorded footage, if it doesn’t something is clearly wrong.

If you make a check with the Smart Client please verify that there is recorded footage so there is something to navigate.

I know it is not you favorite language but I would suggest you debug the sample and your app so that you can compare. First step of course is to see if the sample works as you expect.

I got it working. The problem was it should do it after the video finally loads, then I added

PlaybackData.End to go to last recorded portion

One question,

VideoOS.Platform.Client.ImageViewerControl.EnableVisibleTimeStamp is enabling time to show but I wonder how can I know what timezone, or get the time as return value

for example, how can I get this value

If you backtrack a little I wrote.. “In the sample the PlaybackTimeChangedHandler is used to display the time being played back”. This is how you can get the time. I believe you get the time always in UTC, then you can convert to local time.

Yep this was my approach, changing the time according to my time zone in the same function.

I was thinking being able to change it in whole system of the process.

Thank you Bo Ellegard. I have successfully solved this problem