/ Forside / Teknologi / Udvikling / VB/Basic / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
VB/Basic
#NavnPoint
berpox 2425
pete 1435
CADmageren 1251
gibson 1230
Phylock 887
gandalf 836
AntonV 790
strarup 750
Benjamin... 700
10  tom.kise 610
WindowsMediaPlayer
Fra : peter


Dato : 17-06-03 16:07

Hello,

I built in the WindowsMediaPlayer in a form, but I can't get it working.
Does anayone have some sample-code for me?

Thanks,

Peter



 
 
Frank Adam (17-06-2003)
Kommentar
Fra : Frank Adam


Dato : 17-06-03 18:58

On Tue, 17 Jun 2003 17:06:40 +0200, "peter" <iwi@iwi.myweb.nl> wrote:

>Hello,
>
>I built in the WindowsMediaPlayer in a form, but I can't get it working.
>Does anayone have some sample-code for me?
>
May be a silly question, but what exactly doesn't work ?

Private Sub PlayFile(s as string) 's = your path to a media file
   WMP.FileName = s
   WMP.Play
End Sub

If that doesn't work, then you may be setting a file that is not
supported by the media player.

--

Regards, Frank

peter (18-06-2003)
Kommentar
Fra : peter


Dato : 18-06-03 09:04


"Frank Adam" <fajp@xxxxoptushome.com.au> wrote in message
news:3eef5503.5091644@news-vip.optusnet.com.au...
> On Tue, 17 Jun 2003 17:06:40 +0200, "peter" <iwi@iwi.myweb.nl> wrote:
>
> >Hello,
> >
> >I built in the WindowsMediaPlayer in a form, but I can't get it working.
> >Does anayone have some sample-code for me?
> >
> May be a silly question, but what exactly doesn't work ?
>
> Private Sub PlayFile(s as string) 's = your path to a media file
> WMP.FileName = s
> WMP.Play
> End Sub
>
> If that doesn't work, then you may be setting a file that is not
> supported by the media player.
>
> --
>
> Regards, Frank

What I did is:

1. create a form

2. put the Windows Media player on it

3. doubleclcked the "PLAY"-button to add the code I need to play the file
"c:\temp\heaven.mp3"

When I typede the code: "WindowsMediaPlayer1." I got a listbox with lots of
items but not the ones you mentioned (Filename, Play).

double-clicking the play-button gave me the following:



Private Sub WindowsMediaPlayer1_OpenStateChange(ByVal NewState As Long)

' WHAT CODE HERE?

End Sub



FoSweb (18-06-2003)
Kommentar
Fra : FoSweb


Dato : 18-06-03 12:11

You are using the newer WMP control...

Simply use the player.URL = Filename to set the file you want to play.
Also, this doesnt go where you have 'WHAT CODE HERE
But in the place where you load your file...

Check out
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwmt/html/
vb_player_article.asp

Michael.


> double-clicking the play-button gave me the following:
>
>
>
> Private Sub WindowsMediaPlayer1_OpenStateChange(ByVal NewState As Long)
>
> ' WHAT CODE HERE?

Dont put the code for loading files here. Put code for what happens when the
user presses one of the WMP control buttons here.

>
> End Sub





Søg
Reklame
Statistik
Spørgsmål : 177557
Tips : 31968
Nyheder : 719565
Indlæg : 6408879
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste