0

I am using wxWidgets samples code for media player. Here first we need to select the file from the wxFileDialog and on clicking play button it will play the video.

But I don't want to select the file from the wxFileDialog, I am passing the video path in DoOpenFile(path, bNewPage); and then clicking on play button then the video is not playing.

void wxMediaPlayerFrame::OnPlay(wxCommandEvent& WXUNUSED(event))
{
    DoOpenFile(_("D:\\myvideo.mp4"), false);
    wxMediaPlayerNotebookPage* currentpage = (wxMediaPlayerNotebookPage*)m_notebook->GetCurrentPage();

 ....
 ....
 ....
}
badai shaibaz
  • 47
  • 1
  • 7
  • what is your wx version? What OS? Can you play the file in the sample? – Igor Dec 30 '20 at 01:00
  • I am using wxWidgets-3.1.4, windows 10 OS. And yes file is playing in the sample. I think because I am adding in filepath in `OnPlay`, it is trying to play even before the file is completely loaded. Am I right? – badai shaibaz Dec 30 '20 at 03:33
  • @badaishabaz, you do need to load the file prior to playing. Just do exactly what the sample is doing and everything will be fine... – Igor Dec 30 '20 at 08:55
  • I don't want all the controls, and menu bar. Just Play & Pause button. – badai shaibaz Jan 03 '21 at 09:06
  • my point is that you can't play the video without loading it first. – Igor Jan 03 '21 at 17:39

0 Answers0