O'Reilly logo

Microsoft® Visual Basic® .NET Programmer's Cookbook by Matthew MacDonald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Play Media Files

Problem

You want to play movie video (for example, MPEG files) or MP3 audio files.

Solution

Add the ActiveX MCI control for multimedia, and connect it to a PictureBox control if you need to display video.

Discussion

The .NET Framework does not include any classes for playing multimedia such as sounds, videos, or MIDI files. recipe Play a WAV File described how you can use the Win32 API to play WAV files. Even more functionality is available if you use the MCI ActiveX control. However, the MCI ActiveX control is not included with .NET—it’s installed with earlier versions of Visual Studio, such as Visual Basic 6. Although you can redistribute the MCI ActiveX control with applications that use it, you’ll need to have a product such as ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required