borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Set BackColor)Next Topic (vb6 - vb6sp) New Topic New Poll Post Reply
AndreaVB Forum : VB General : Windows Media Player Control
Poster Message
Shady
Level: VB Guru


Registered: 08-07-2002
Posts: 305

icon Windows Media Player Control

Hi All,

I have a real simple problem here, which I am trying to resolve with little success.

All I want to do is use the Windows Media Player Control in VB to play a .WAV file of my choosing, I'm guessing the play/stop/pause controls are built in, but how do you tell the Windows Media Player control which file you want to play.

Come on guys, I bet someone knows.

Regards

Shady

____________________________
I don't wanna die... but I ain't keen on livin' either

29-10-2003 at 01:15 PM
View Profile Send Email to User Show All Posts | Quote Reply
steve_w
Level: Moderator


Registered: 18-04-2003
Posts: 1156
icon Re: Windows Media Player Control

MediaPlayer1.FileName =

Steve

29-10-2003 at 01:41 PM
View Profile Send Email to User Show All Posts | Quote Reply
Shady
Level: VB Guru


Registered: 08-07-2002
Posts: 305
icon Re: Windows Media Player Control

Nope,

Tried that and it gives me object does not suppoert this method!!

Im using the WindowsMediaPlayer object that uses wmp.dll

Any other ideas?

Shady

[Edited by Shady on 29-10-2003 at 04:14 PM GMT]

____________________________
I don't wanna die... but I ain't keen on livin' either

29-10-2003 at 04:12 PM
View Profile Send Email to User Show All Posts | Quote Reply
steve_w
Level: Moderator


Registered: 18-04-2003
Posts: 1156
icon Re: Windows Media Player Control

mmmmm Don't have that one.

What OS are using Shady and did the dll come with it?

29-10-2003 at 05:01 PM
View Profile Send Email to User Show All Posts | Quote Reply
Shady
Level: VB Guru


Registered: 08-07-2002
Posts: 305
icon Re: Windows Media Player Control

Err?  

I dunno?

That is I am using Windows XP PRO (I know that bit)

but I don't know if the .dll came with it, i guess it must have, cos I haven't knowingly installed it myself, I have updated VB6 with the service pack 5, don't know if that would have had any effect.

Shady

____________________________
I don't wanna die... but I ain't keen on livin' either

29-10-2003 at 05:32 PM
View Profile Send Email to User Show All Posts | Quote Reply
dkg354boy2
Level: Guest

icon Re: Windows Media Player Control



    windowsmediaplayer1.url = ****


    I am working on something similar myself....

          Good luck!!

              DORK BOY 4 LIFE.......

13-11-2003 at 03:33 AM
| Quote Reply
Nod
Level: Guest

icon Re: Windows Media Player Control


Under W98SE the MediaPlayer uses the file  MSDXM.OCX
I have found that this compiles Ok and runs without problems on XPPro machines. have you got access to that file?


  

Nod.

13-11-2003 at 02:03 PM
| Quote Reply
Shady
Level: VB Guru


Registered: 08-07-2002
Posts: 305
icon Re: Windows Media Player Control

Yes mate,

I had to use that one instead of the newer version.

But dkg354boy2 has now given me the line of code to use it, so now I can use either... what a show off!!

Cheers

Shady

____________________________
I don't wanna die... but I ain't keen on livin' either

13-11-2003 at 02:14 PM
View Profile Send Email to User Show All Posts | Quote Reply
Nod
Level: Guest

icon Re: Windows Media Player Control


Lucky you!!  

Use the new one if you can cos the older one has a few bugs!
in fact, I'm gunna go look for the new one right now!!




Nod.

14-11-2003 at 12:41 PM
| Quote Reply
LEK
Level: Guest

icon Re: Windows Media Player Control

I´m using Media Player 9 control (wmp.dll).
I recommend the upgrade that works just fine with the apropriate DIVX codec...

It´s simple to put it to work
add the control, put it on a form

...
WindowsMediaPlayer1.url = "e:\animatrix.avi"
WindowsMediaPlayer1.FullScreen = True
...
and you´re done.

MY QUESTION:
How to put a playlist to work?
I want to put itens (many avi files to play in sequence), remove them etc

Does anybody knows how to do this?



19-12-2003 at 09:31 PM
| Quote Reply
LEK
Level: Guest

icon Re: Windows Media Player Control

I´m using Media Player 9 control (wmp.dll).
I recommend the upgrade that works just fine with the apropriate DIVX codec...

It´s simple to put it to work
add the control, put it on a form

...
WindowsMediaPlayer1.url = "e:\animatrix.avi"
WindowsMediaPlayer1.FullScreen = True
...
and you´re done.

MY QUESTION:
How to put a playlist to work?
I want to put itens (many avi files to play in sequence), remove them etc

Does anybody knows how to do this?



19-12-2003 at 09:32 PM
| Quote Reply
LEK
Level: Guest

icon Re: Windows Media Player Control

I´m using Media Player 9 control (wmp.dll).
I recommend the upgrade that works just fine with the apropriate DIVX codec...

It´s simple to put it to work
add the control, put it on a form

...
WindowsMediaPlayer1.url = "e:\animatrix.avi"
WindowsMediaPlayer1.FullScreen = True
...
and you´re done.

MY QUESTION:
How to put a playlist to work?
I want to put itens (many avi files to play in sequence), remove them etc

Does anybody knows how to do this?



19-12-2003 at 09:32 PM
| Quote Reply
LEK
Level: Guest

icon Re: Windows Media Player Control

I´m using Media Player 9 control (wmp.dll).
I recommend the upgrade that works just fine with the apropriate DIVX codec...

It´s simple to put it to work
add the control, put it on a form

...
WindowsMediaPlayer1.url = "e:\animatrix.avi"
WindowsMediaPlayer1.FullScreen = True
...
and you´re done.

MY QUESTION:
How to put a playlist to work?
I want to put itens (many avi files to play in sequence), remove them etc

Does anybody knows how to do this?

thanks



19-12-2003 at 09:33 PM
| Quote Reply
doofusboy
Level: Scholar

Registered: 13-05-2003
Posts: 30
icon Re: Windows Media Player Control

Here's code I've used to create a playlist from a listbox of user selected songs:

   Set sPlaylist = WindowsMediaPlayer1.playlistCollection.newPlaylist("Audio")
    WindowsMediaPlayer1.currentPlaylist = sPlaylist 'selects playlist
    For i = 0 To Form1.List1.ListCount - 1
        Set sMedia = WindowsMediaPlayer1.mediaCollection.Add("C:\Program Files\3Com\My Documents\My Music\Dad\VariousArtists\" & Form1.List1.List(i)) 'Sets Media to Add to Playlist
        WindowsMediaPlayer1.currentPlaylist.insertItem (WindowsMediaPlayer1.currentPlaylist.Count), sMedia ' Adds Playlist Item
    Next i

27-12-2003 at 12:40 PM
View Profile Send Email to User Show All Posts | Quote Reply
LEK
Level: Guest

icon Re: Windows Media Player Control

It has worked perfectly with avi files too.

thanks a lot!
LEK

[Edited by LEK on 27-12-2003 at 06:52 PM GMT]

27-12-2003 at 06:51 PM
| Quote Reply
Fistandantilus
Level: Guest

icon Re: Windows Media Player Control

Ok ... one more thing,

I´m trying to remove some medias from the playlist, for that, I need to call the function requestMediaAcessRights like so:

WindowsMediaPlayer1.settings.requestMediaAccessRights ("full")

When I do this, a dialog box appears that asks me if I want to allow full access from an application in my computer to my media library. But, this cannot happen ... The application must run without interaction from the user.

How can I solve this? How can I make my computer allow full access to the media library without having to answer, everytime an application requests access to the library?

10-01-2004 at 06:06 PM
| Quote Reply
part
Level: Guest

icon Re: Windows Media Player Control

Hi,

I see things very interessant in this topic and i have one problem: i made a program to read the paralell port with sensors. After a sensor activate it plays one video. But the WMP does appear automaticly; only after i press control+break. Anyone can help me?

Thanks!

06-06-2004 at 05:10 PM
| Quote Reply
AndreaVB Forum : VB General : Windows Media Player Control
Previous Topic (Set BackColor)Next Topic (vb6 - vb6sp) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder