Click here to Skip to main content
15,918,889 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
The below code is for playing one file.
axWindowMediaPlayer1.url=@"path of file";

but how to play more than one file one after another and that are stored in same directory

please help me..........
Posted

1 solution

First create an array to keep string paths.
These are Windows Media Player Status :
0 = Undefined
1 = Stopped (by User)
2 = Paused
3 = Playing
4 = Scan Forward
5 = Scan Backwards
6 = Buffering
7 = Waiting
8 = Media Ended
9 = Transitioning
10 = Ready
11 = Reconnecting
12 = Last
So You should enter that event :
bool ended=false;
private void axWindowsMediaPlayer1_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e)
        {
            if (e.newState == 8)//Media finished
            {
                ended = true;
            }
 
           }

And then try to use a timer to control is media ended.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900