5
Contributors
6
Replies
39
Views
6 Years
Discussion Span
Last Post by 良红
0

This would depend on the kind of video... A flash video? HTML 5?? What Codecs?? AVI? WMV? MP4? What kind.. There is no specific code to play every single type of video that exists..

0

This would depend on the kind of video... A flash video? HTML 5?? What Codecs?? AVI? WMV? MP4? What kind.. There is no specific code to play every single type of video that exists..

any video file like .avi or .swf file etc..

-1

Create a Windows Form application (CLR - Windows Form Application). Right click on Tools box to add a new COM component. Select Windows Media Player, check it and push OK. It will be added to Toolbox.
Draw a Media Player control on the form. In the Property Box set the property URL to the pathname of the file you want to play. You can also set this property programatically.
For example, if you add an openFileDialog control to choose the file and a button, you can write the following code for the event click of the button:

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

Edited by mike_2000_17: Fixed formatting

0

if you are running windows, and are willing to compromise a bit, you could use a batch file to help you out, in your c++ code, type:
system("example.bat");
then open notepad and type:
start filename.any
and save it as example.bat

0

AVI code as follows.

The way AVI played and controlled is similar with audio files, you can set parameter uMsg in function mciSendCommand as avivideo. Here is the code.

else if(strcmp(pFileExt,"AVI") == 0 || strcmp(pFileExt,"avi") == 0){
    mciOpenParms.lpstrDeviceType = "avivideo";
    type = AVI;
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.