How to use VideoPlayer to play video on application window?
Posted: 22 Apr 2021, 11:06
Hello, I'm a new student on BCI2000. I try to use VideoPlayer class to play a video on application window and successfully open video, but failed while playing video. The video duration is 1.05s. I create a new application module and add a piece of code,as follows:
void VideoDemoTask::StartRun()
{
VideoPlayer videoPlayer(mrDisplay);
videoPlayer.Open("D://project//video//M1//left.avi");
if (videoPlayer.IsOpen()) {
bciout << "open "<< endl;
}
int c = videoPlayer.FrameCount();
bciout << c << endl;
videoPlayer.SetFramePosition(0);
videoPlayer.Play();
if (videoPlayer.IsPlaying()) {
bciout << "PLAY " << endl;
}
}
In addition, I want to return a message as soon as the video is over. How do i do it?
void VideoDemoTask::StartRun()
{
VideoPlayer videoPlayer(mrDisplay);
videoPlayer.Open("D://project//video//M1//left.avi");
if (videoPlayer.IsOpen()) {
bciout << "open "<< endl;
}
int c = videoPlayer.FrameCount();
bciout << c << endl;
videoPlayer.SetFramePosition(0);
videoPlayer.Play();
if (videoPlayer.IsPlaying()) {
bciout << "PLAY " << endl;
}
}
In addition, I want to return a message as soon as the video is over. How do i do it?