473,479 Members | 2,117 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

windows media player

I'm trying to use windows media player in an app. I can give it an mp3
and it plays it, but if I give it a playlist it will not play and even
the play button on the control is not active.

btn_open_mediaFile works fine,
tn_open_playlist acts likes nothing happened except I see the name of
the playlist. What am I missing?
Also, if an mo3 is playing, loading a playlist stops it from playing.
here is my code
private void btn_open_mediaFile_Click(object sender, EventArgs
e)
{
openFileDialog1.Filter = "music|*.mp3";
openFileDialog1.ShowDialog();
string filename = openFileDialog1.FileName;
player.URL = filename;
}

private void btn_open_playlist_Click(object sender, EventArgs
e)
{
openFileDialog1.Filter = "playlists|*.wpl";
openFileDialog1.ShowDialog();
string filename = openFileDialog1.FileName;
player.currentPlaylist =
player.mediaCollection.getByName(filename);
currentPlaylistLabel.Text = ("Found first playlist. Name =
" + player.currentPlaylist.name);
player.Ctlcontrols.play();// does not work with or without
this line
}

any help would be greatly appreciated
Thanks
Ringo

Jul 24 '07 #1
1 3509
Ringo,

I'm just guessing, but it could be that the media collection that you
are accessing doesn't have the playlist loaded yet. Is there a method to
load the playlist from the filename?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ringo" <ri*********@gmail.comwrote in message
news:11**********************@r34g2000hsd.googlegr oups.com...
I'm trying to use windows media player in an app. I can give it an mp3
and it plays it, but if I give it a playlist it will not play and even
the play button on the control is not active.

btn_open_mediaFile works fine,
tn_open_playlist acts likes nothing happened except I see the name of
the playlist. What am I missing?
Also, if an mo3 is playing, loading a playlist stops it from playing.
here is my code
private void btn_open_mediaFile_Click(object sender, EventArgs
e)
{
openFileDialog1.Filter = "music|*.mp3";
openFileDialog1.ShowDialog();
string filename = openFileDialog1.FileName;
player.URL = filename;
}

private void btn_open_playlist_Click(object sender, EventArgs
e)
{
openFileDialog1.Filter = "playlists|*.wpl";
openFileDialog1.ShowDialog();
string filename = openFileDialog1.FileName;
player.currentPlaylist =
player.mediaCollection.getByName(filename);
currentPlaylistLabel.Text = ("Found first playlist. Name =
" + player.currentPlaylist.name);
player.Ctlcontrols.play();// does not work with or without
this line
}

any help would be greatly appreciated
Thanks
Ringo

Jul 30 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2035
by: Mickel Grönroos | last post by:
Hi! Anybody tried using Windows Media Player 9 via win32com? (And more precisely, combining that with a Tkinter application.) I found a few earlier threads on Windows Media Player and Python,...
1
8887
by: Anise | last post by:
I have a question concerning embedding a windows media player into a web application in .net.. I download Windows Media Player 10 and its SDK On the .ascx page I placed a windows media player...
1
7863
by: Stephen Adam | last post by:
Hi there, Have spent a while trying to find out how to connect to Windows Media Player through COM. Unfortunately there doesnt seem to be much stuff about it on the web. What I need to do is...
4
7807
by: BobAchgill | last post by:
What is the best way to show a video file directly in a Form? Can I use functions of Windows Player in a Windows Form? Functions like: play video or show visualization for music, etc.
3
5167
by: UJ | last post by:
I have a .avi file that uses the Divx codec. If I load it with windows media player program it works fine. If I load it using my control in a program, it doesn't display. Over standard media files...
5
4548
by: Paul Fi | last post by:
I have this code which tries to obtain the number of items in the current playlist of windows media player: private void MainForm_Load(object sender, System.EventArgs e) { // get Window handle...
1
5503
by: sri2097 | last post by:
Basically, I want to check if a URL is playable or not (without actually playing it). i.e. given a URL I want to write an automation script to figure it out for me if it's playable or not. If...
19
19221
by: Tony | last post by:
I'm working on project that plays movies using Windows Media Player and I'm controlling everything with JavaScript. Per the client I only need to support IE 6 or greater which happens to make...
0
1879
by: dongarbage | last post by:
Hi there, I've created a user control to put in a web page. I'd like to add a windows media player control to the user control that I've created. But, for some reason, the user control does not...
0
2651
by: artsohc | last post by:
Hey Everyone, this is my first time posting so go easy on me. I am trying to hook up music-on-hold at the office I work at. I got all the music loaded and I got Windows Media Player working while...
0
7027
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7067
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6719
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6847
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4757
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
2980
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2970
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1288
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
555
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.