none
How to play the audio and video files in Internet Explorer

    Question

  • Hi,

     

    Does any one has idea on how to play the audio and video files in Internet Explorer?

     

    The User will select the file to be played from a C# Windows Form( contains an user control and it contains options to take the files to be played.)

     

    please let me know any pointers to move ahead. Thanks in Advance

     

     

     

    Monday, March 17, 2008 8:15 AM

Answers

  •  

    Hi lakshmi09,

    I don’t why you need to play audio and video in Internet Explorer. Usually we play audio and video with the associated software like Windows Media Player. We can use the Process.Start method to open the audio or video with its associated software. Try something like the following:

    Code Snippet
             System.Diagnostics.Process.Start(@"C:\video.wmv");

     

    To open the audio and video in Internet Explorer, I would like to suggest you create a temp html file which refers to the audio or video file. And then you should use the Internet Explorer to open the temp file. Your temp html file should be something like the following:

    Code Snippet

    <html>

    <head>

    <script src="res://mshtml.dll/objectembed_neutral.js"></script>

    </head>

    <body objectSource="file:///C:/myvideo.wmv" onload="ObjectLoad();"leftmargin=0 topmargin=0 scroll=no>

    <form id="objectDestination"></form>

    </body>

    </html>

     

    Hope this helps.
    Best regards.
    Rong-Chun Zhang

    Friday, March 21, 2008 6:43 AM