How to implement music playback and video playback in C # Winform

Source: Internet
Author: User
Tags visual studio 2010

How to implement music playback and video playback in C # Winform

Namespace WindowsFormsApplication1

{

public partial class Form2:form

{

Public Form2 ()

{

InitializeComponent ();

SoundPlayer sp = new SoundPlayer ("C:/users/xingping.xu/documents/visual Studio 2010/projects/consoleapplication1/ Consoleapplication1/beautifultonight.wav ");//must be an audio file with a. wav extension

Sp. Playlooping ();//Loop play

Axwindowsmediaplayer1.url = "d:/vedios/2010 South Africa World Cup goal highlights 2010. DIY version-csdhd-01.avi ";

AxWindowsMediaPlayer1.settings.setMode ("Loop", true);

List<string> playlist=new list<string> ();

Playlist. ADD ("d:/vedios/2010 South Africa World Cup goal highlights 2010. DIY version-csdhd-01.avi ");

Playlist. ADD ("d:/vedios/2010 South Africa World Cup goal highlights 2010. DIY version-csdhd-02.avi ");

foreach (string item in playlist)

{

AxWindowsMediaPlayer1.currentPlaylist.appendItem (Axwindowsmediaplayer1.newmedia (item));

}

}

}

}

How to implement music playback and video playback in C # Winform

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.