Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 567479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:05:14+00:00 2026-05-13T13:05:14+00:00

I like to play video files, such as AVIs, through my C# program. Is

  • 0

I like to play video files, such as AVIs, through my C# program. Is it possible to play video files like that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T13:05:14+00:00Added an answer on May 13, 2026 at 1:05 pm

    You should be able to use the Media Player control to play media files.

    Example of playing audio from http://msdn.microsoft.com/en-us/library/dd562692(VS.85).aspx, you should be able to adapt it to video:

    // [ C# ]
    WMPLib.WindowsMediaPlayer Player;
    
    private void PlayFile(String url)
    {
        Player = new WMPLib.WindowsMediaPlayer();
        Player.PlayStateChange += 
            new WMPLib._WMPOCXEvents_PlayStateChangeEventHandler(Player_PlayStateChange);
        Player.MediaError += 
            new WMPLib._WMPOCXEvents_MediaErrorEventHandler(Player_MediaError);
        Player.URL = url;
        Player.controls.play();
    }
    
    private void Form1_Load(object sender, System.EventArgs e)
    {
        // TODO  Insert a valid path in the line below.
        PlayFile(@"c:\myaudio.wma");
    }
    
    private void Player_PlayStateChange(int NewState)
    {
        if ((WMPLib.WMPPlayState)NewState == WMPLib.WMPPlayState.wmppsStopped)
        {
            this.Close();
        }
    }
    
    private void Player_MediaError(object pMediaObject)
    {
        MessageBox.Show("Cannot play media file.");
        this.Close();
    }
    

    There’s a bit more information available on MSDN at http://msdn.microsoft.com/en-us/library/dd564582(VS.85).aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to play video files like AVI , MP4 , etc.?
i want to play video files like wmv and flv in my asp.net mvc
I would like to play a video from inside the rendered page with an
I would like to play/pause video using jquery. Here is my code: (function ($)
I'd like to play around with building a recommendations system, and by that I
I'm trying to implement a MPMoviePlayerView but I can't play the video files, I
I have a video that I play. To use full screen in iOS 3.2
I am working on Ubuntu. I would like to record on asterisk video files
I have an ASX stream that I would like to play on my Windows
I would like to make a Flash video player that takes a URL as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.