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

i want to play video files like wmv and flv in my asp.net mvc
I'd like to play mp3 files (b/c they compress smaller than .wav's) from a
Like many companies that require all access be through stored procedures, we seem to
I'm trying to implement a MPMoviePlayerView but I can't play the video files, I
I'm using Microsoft.DirectX.AudioVideoPlayback.Video class to play a video file and I would like to
I've been wondering something, websites like youtube (pandora does mp4s) play their music through
File formats I would like to play include .wav, .mp3, .midi. I have tried
Like most *nix people, I tend to play with my tools and get them
How can I play audio (it would be like a 1 second sound) from
How can I store a video (either in database or file system) so that

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.