TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
rumman ashraf
NA
1
1.9k
C# using WinForms how do I play MPEG2 by using WMP library?
Apr 23 2013 6:53 AM
Hello ,
I am a C# beginner. I am trying to make a media player that can play MPEG2 files.I have used Windows Media Player COM component to make a basic media player. Now I need to modify it so that it can play MPEG2 files. Any suggestion or links that can help me in this matter would be great.
Code :
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Media_Player_Basic
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void openToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileDialog open = new OpenFileDialog();
open.Title = "Open";
open.Filter = "All Files|*.*";
try
{
if (open.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
BasicWindowsMediaPlayer.URL = (open.FileName);
}
}
catch (ArgumentException ex) {
MessageBox.Show(ex.Message.ToString(),"Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString(), "Massive Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}
Reply
Answers (
0
)
Best printing method in C#?
Month Calendar Control