+ if( !GetCurrentMediaCtrl()->Play() )
+ wxMessageBox(wxT("Couldn't play movie!"));
+
+ ResetStatus();
+
+ GetCurrentSlider()->SetRange(0,
+ (int)(GetCurrentMediaCtrl()->Length() / 1000));
+ }
+}
+
+// ----------------------------------------------------------------------------
+// MyFrame::OnOpenURLSamePage
+//
+// Called from file->openurl.
+// Opens and plays a media file from a URL in the current notebook page
+// ----------------------------------------------------------------------------
+void MyFrame::OnOpenURLSamePage(wxCommandEvent& WXUNUSED(event))
+{
+ OpenURL(false);
+}
+
+// ----------------------------------------------------------------------------
+// MyFrame::OnOpenURLNewPage
+//
+// Called from file->openurlinnewpage.
+// Opens and plays a media file from a URL in a new notebook page
+// ----------------------------------------------------------------------------
+void MyFrame::OnOpenURLNewPage(wxCommandEvent& WXUNUSED(event))
+{
+ OpenURL(true);
+}
+
+// ----------------------------------------------------------------------------
+// MyFrame::OpenURL
+//
+// Code to actually open the media file from a URL
+//
+// 1) Create text input dialog and ask the user for an input URL
+// 2) If the user didn't want anything, break out
+// 3) Create a new page if the user wanted one or there isn't a current page
+// 4) Load the media
+// 5) Play the media
+// 6) Reset the text on the status bar
+// 7) Set the slider of the current page to accurately reflect media length
+// ----------------------------------------------------------------------------
+void MyFrame::OpenURL(bool bNewPage)
+{
+ wxString theURL = wxGetTextFromUser(wxT("Enter the URL that has the movie to play"));
+
+ if(!theURL.empty())
+ {
+ if(bNewPage || !m_notebook->GetCurrentPage())
+ m_notebook->AddPage(new MyNotebookPage(m_notebook), theURL, true);
+ else //don't forget to update notebook page title
+ m_notebook->SetPageText(m_notebook->GetSelection(), theURL);
+
+ if( !GetCurrentMediaCtrl()->Load(wxURI(theURL)) )
+ wxMessageBox(wxT("Couldn't load URL!"));
+
+ if( !GetCurrentMediaCtrl()->Play() )