Click here to Skip to main content
15,912,329 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.DirectX.AudioVideoPlayback;
namespace webplayer
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            try
            {
                int width = panel1.Width;
                int height = panel1.Height;
              System.Uri u = new Uri("http://cassfordinfo.com/Testmovie.avi");                Video video;
              video = Video.FromUrl(u);

                video.Owner = panel1;
                video.Stop();
                video.Play();

                // resize the video to the size original size of the panel

                panel1.Size = new Size(width, height);
            }catch(Exception gh)
            {
                MessageBox.Show(gh.ToString());
            }
        }

    }
}

when i run the above code it shows the below exception
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.DirectX, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.<br />
File name: 'Microsoft.DirectX, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'<br />
   at Microsoft.DirectX.AudioVideoPlayback.Video..ctor()<br />
   at Microsoft.DirectX.AudioVideoPlayback.Video.FromUrl(Uri address)<br />
   at webplayer.Form1.Form1_Load(Object sender, EventArgs e) in C:\Documents and Settings\vishnu\My Documents\Visual Studio 2008\Projects\webplayer\webplayer\Form1.cs:line 28<br />
<br />
WRN: Assembly binding logging is turned OFF.<br />
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.<br />
Note: There is some performance penalty associated with assembly bind failure logging.<br />
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
Posted
Updated 11-Jul-11 21:31pm
v3

1 solution

This is just a guess, but do you have DirectX installed? Try running DXDiag and make sure it is correctly installed, and the version you expect.

It may be worth re-installing your drivers as a precaution.
 
Share this answer
 
Comments
vishnulalr 12-Jul-11 3:25am    
you are wright now its working thanks

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