Click here to Skip to main content
15,914,608 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Can any1 provide me with code 2gther wif explaination for inserting AVI Video and being able to play it without it saying "Video Was Stopped" the moment i open the file.Thank You :-D
Posted
Updated 10-Jun-10 19:37pm
v2
Comments
Sandeep Mewara 11-Jun-10 1:25am    
Reason for my vote of 1
1. Demanding
2. No effort - show us what have you tried?

1 solution

C#
private bool CheckValidity(string strName)
        {
            //show error if user specified invalid file
            if (strName.EndsWith(".avi") == false)
            {
                MessageBox.Show("File name must end with .avi", "Invaild File Type", MessageBoxButtons.OK, MessageBoxIcon.Error);
                MessageBox.Show("Fill in the empty box");
                return false;//to indicate invalid file type
            }

            //change status of Buttons if file name is valid
            else
            {
                btnOpenFile.Enabled = false;
                btnEnter.Enabled = true;

                return true;//to indicate text file specified
            }
        }//end method CheckValidity


        private void btnLoadImage_Click(object sender, EventArgs e)
        {
            if (objOpenFileDialog.ShowDialog() == DialogResult.OK)
            {
                // create video source
                AVIFileVideoSource fileSource = new AVIFileVideoSource(objOpenFileDialog.FileName);

                OpenVideoSource(fileSource);


            }

        }
 
Share this answer
 
Comments
LittleYellowBird 11-Jun-10 4:04am    
Hi, you seem to have added an Answer to your own question. If this is the part of the code that you have a problem with, may I suggest you start a new Question? Plus you will get more help if you don't ask for code, rather ask for help with a specific problem and if you don't use 'text speak', its better to use proper English that everyone can read and understand easily. Just a thought. Good Luck :-)
Merojan 20-Feb-11 1:54am    
How can the VideoSourcePlayer adds in toolbox?
I appreciate it.

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