views:

122

answers:

3
                string host = "http://youtube.com/v/";
        string end = ".flv";
        WebClient Client = new WebClient ();
        StreamReader sr = new StreamReader(@"ids.txt");
        string line;
        do
         {
         line = sr.ReadLine();
         Client.DownloadFile(host+line+end,line+end);

         }
         while (line !=null);
         sr.Close();

Works fine but later than i shall run the flv/video this gives me this error >

An error occurred when the file plays in Windows Media Player

Why, What i'm doing wrong?

+5  A: 

It's a FLV (Flash Video) file. Not all versions of Windows Media Player can play FLV Files. You would need an FLV player if you do not have it setup properly. To play it in WMP you can try: WMP FLV Playing

NebuSoft
Or use VLC player, which can play a lot of file formats, including FLV, if it's not too much effort installing it.
Pindatjuh
+1  A: 

VLC ( http://www.videolan.org/vlc/ ) also does a good job at playing just about everything.

As an added bonus you can start watching while the download is in progress since vlc doesn't try to lock the file

edorian
+1  A: 

You need to use an FLV player. By default, Windows Media Player will not play FLV files.

I haven't tried this myself and am basing it on a quick Google search, but if you absolutely need to use Windows Media Player you can try installing an FLV codec (just search google and you'll find some). I believe VLC will also play FLVs out of the box.

Alex Beardsley