Hi doublemax, Ultimately, I want to show the video on the Main Parent Frame.
I have written the following code. However, it is not playing my ".avi" file. I tried searching the documentations for supported media files for wxWidgets but I could not find any.
I have referred to the following document
https://docs.wxwidgets.org/3.0/classwx_ ... 549bde6284
and Written the following codes to show a media file but it is not working
Code: Select all
void cMain::FilePathShowVideo()
{
wxString Filter = "mp4|*.mp4|avi|*.avi"; //TO:DO Select Mode for Video
wxFileDialog
openFileDialog(this, ("Load Video File"), "", "", Filter , wxFD_OPEN | wxFD_FILE_MUST_EXIST); //Select Mode of Files
if (openFileDialog.ShowModal() == wxID_CANCEL)
{ m_list1->AppendString("User Cancelled");
return;
}
else
selectedfilepath = openFileDialog.GetPath();
//Code to Open File here and Display
wxFileInputStream input_stream(openFileDialog.GetPath());
m_list1->AppendString(selectedfilepath);
if (!input_stream.IsOk())
{
wxLogError("Cannot open file '%s'.", openFileDialog.GetPath());
return;
}
//Showing Video In the Same Parent Frame
std::string a = std::string(selectedfilepath.mb_str(wxConvUTF8));
video_panel = new wxMediaCtrl(this, wxID_ANY, a, wxPoint(10, 100), wxSize(400, 400));
if (video_panel->GetState() != wxMEDIASTATE_PLAYING && video_panel->Stop() == FALSE) {
video_panel->Play();
}
}
The Media File will be loaded by me via an Event.
Any help?