Click here to Skip to main content
15,896,269 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi i want to play two different video in same application using visual c++
i do not want to use opencv. and i dnt want callabny other .exe file forplaying.
is there any videobox kind thing is present like picturebox
Posted

Hm... Add new COM component -> Windows Media Player (as you mentioned "picturebox" I am assuming you are talking about forms, right ?). In the properties of that component you will find where to insert path to your video etc ...
Also , you could add another button and write something like :

C++
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) 
{
openFileDialog1->ShowDialog();
axWindowsMediaPlayer1->URL = openFileDialog1->FileName;  
}

hope this helps .. I don't know any better :)
 
Share this answer
 
Comments
pranav_30 17-Nov-11 4:34am    
i do not want to call media player i want handle video by same application
Unless you want to write yourself all the video decoding and rendering (and with all the video format existing will be a project that may take years!) you must rely on some external component.

On windows that "componet" is the "media player" (don't think to it in term of the application you lauch clicking the icon: that just a small exe loading a bunch of DLLs that do the real job! I'm talking about the DLL themselves).

To access those DLLs you have to call their own API that are expressed in the form fo a COM object (hence RKnGI solution).

As an alternative, you ca look at the VLC project[^], either as a compoent "a-la mediaplayer" or as a library (you can download the sources) to link to.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900