locked
How to play video and audio files in windows mobile 6.5 with C# RRS feed

  • Question

  • HI.

    Im new in this forum and i have a question: i'm programming an application that needs to play video and audio files for windows mobile 6.1 or 6.5 in C#, with visual studio 2008 and compact framework 3.5 but i have read a lot of posts and i dont have the solution for this problem.

    Can someone help me?
    • Moved by Chao Kuo Friday, January 22, 2010 4:02 AM (From:Visual C# General)
    Tuesday, January 19, 2010 10:21 AM

Answers

  • i found two solutions but i prefer the second:


    First:

            string path = "\\Datos\\niceday.wmv\\";
            Process.Start("\\Windows\\Menú Inicio\\Programas\\Windows Media.lnk", (path));

      This solution tell you a win32 exception.


    Second:

            string path = "\\Datos\\niceday.wmv";

            System.Diagnostics.Process proceso = new System.Diagnostics.Process();
            proceso.StartInfo.WorkingDirectory = "\\Windows\\Menú Inicio\\Programas\\Windows Media.lnk";
            proceso.StartInfo.FileName = path;
            proceso.Start();

      This solution is better than first.

    And now i have a question about... Can i run this code inside a frame like a panel or something like that. I'd like to get this
    in order to add 2 buttons that play 2 different videos and the interface would be these 2 buttons and the player above them.

    Thank's in advanced for your help.
    • Marked as answer by sergioa_1987 Friday, January 22, 2010 10:59 AM
    Tuesday, January 19, 2010 12:54 PM

All replies

  • MP3 is OK, i need the player for video files too.

    Thanks.
    Tuesday, January 19, 2010 11:12 AM
  • you can use wmplayer to play video files but it'll play only those files which can be played in wmplayer.

    u can use :
    Process.Start("wmplayer","filepath");

    I have not tested this code.. lemme know if this works :)
    Paras
    Tuesday, January 19, 2010 11:15 AM
  • i will check this for my program, but if someone could tell me some code sample of the windows media player with video complete...


    Thanks
    Tuesday, January 19, 2010 11:32 AM
  • i found two solutions but i prefer the second:


    First:

            string path = "\\Datos\\niceday.wmv\\";
            Process.Start("\\Windows\\Menú Inicio\\Programas\\Windows Media.lnk", (path));

      This solution tell you a win32 exception.


    Second:

            string path = "\\Datos\\niceday.wmv";

            System.Diagnostics.Process proceso = new System.Diagnostics.Process();
            proceso.StartInfo.WorkingDirectory = "\\Windows\\Menú Inicio\\Programas\\Windows Media.lnk";
            proceso.StartInfo.FileName = path;
            proceso.Start();

      This solution is better than first.

    And now i have a question about... Can i run this code inside a frame like a panel or something like that. I'd like to get this
    in order to add 2 buttons that play 2 different videos and the interface would be these 2 buttons and the player above them.

    Thank's in advanced for your help.
    • Marked as answer by sergioa_1987 Friday, January 22, 2010 10:59 AM
    Tuesday, January 19, 2010 12:54 PM
  • Can someone help me about the next question?

    Can i run this code inside a frame like a panel or something like that. I'd like to get this
    in order to add 2 buttons that play 2 different videos and the interface would be these 2 buttons and the player above them.

    Thank's.
    Wednesday, January 20, 2010 11:02 AM
  • Hello, Sergioa
    If you want to embed your media player control into a panel, you couldn't use Process.Start() to start your video directly. You need to use Windows media player control, to control the media player. Please reference http://msdn.microsoft.com/en-us/library/dd562851(VS.85).aspx. and
    How to: Embed Windows Media Player on a Form.
    Thanks
    Chao
    Thursday, January 21, 2010 9:19 AM
  • It's no possible to use this tools, because i need the control for windows mobile application and your solution is for windows form.

    Thank's
    Thursday, January 21, 2010 9:31 AM
  • Hi,
    I am sorry I forgot this, for smart device question, please post it here.
    http://social.msdn.microsoft.com/Forums/en/windowsmobiledev/threads
    Thanks
    Chao
    Friday, January 22, 2010 4:02 AM