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?
How to use VideoPlayer to play video on application window?
Re: How to use VideoPlayer to play video on application window?
Hi,
your VideoPlayer object is destroyed when execution leaves the StartRun() function. You need to create it on the heap (with "new").
Hope this helps,
Juergen
your VideoPlayer object is destroyed when execution leaves the StartRun() function. You need to create it on the heap (with "new").
Hope this helps,
Juergen
Who is online
Users browsing this forum: No registered users and 4 guests