473,395 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

programming windows media player in c#

I am using the visual express edition 20005 for C#. I am trying to write a
program which will randomly play songs weighted by a 0 to 100 rating scale.
I can player a single song using the windows media player, but I cnnot play
music continuously. I need to either add an event handler which is triggered
by the end of a song, be able to loop while a song is being played while
testing for the end of the song or be able to add a playlist of the chosen
songs and play the playlist. I have tried to create a new playlist, using
the new playlist method, but when I try define an object of type playlist
(Playlist,playList PlayList) it doesn't recognize any of these as a defined
type.
Can someone help me with one or more of these approaches or another
alternative
Oct 28 '06 #1
1 14608
I assume your using the Windows media SDK 9?

If so just capture the StatusChange event and then you can check the
status like this example:

private void axWindowsMediaPlayer1_StatusChange(object sender,
EventArgs e)
{
Console.WriteLine(axWindowsMediaPlayer1.status);
}

The Status will be something like "stopped" when the track is done
playing.
Kelly S. Elias
Webmaster
DevDistrict - C# Code Library
http://devdistrict.com
Sirmarty wrote:
I am using the visual express edition 20005 for C#. I am trying to write a
program which will randomly play songs weighted by a 0 to 100 rating scale.
I can player a single song using the windows media player, but I cnnot play
music continuously. I need to either add an event handler which is triggered
by the end of a song, be able to loop while a song is being played while
testing for the end of the song or be able to add a playlist of the chosen
songs and play the playlist. I have tried to create a new playlist, using
the new playlist method, but when I try define an object of type playlist
(Playlist,playList PlayList) it doesn't recognize any of these as a defined
type.
Can someone help me with one or more of these approaches or another
alternative
Oct 28 '06 #2

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

Similar topics

0
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
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
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...
0
by: Ricky W. Hunt | last post by:
Does anyone have any links to how to program the Windows Media Player? I've found a bunch but their very basic (even the ones from MS in the developer kit). Can you program the EQ from Visual...
4
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
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...
1
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
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
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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
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...

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.