Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Mediaplayer1


does anybody know how to play a dvd using the mediaplayer1 ?

i have took the controls of as i want to use nothing but code.

thanks
thingimijig.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Help With MediaPlayer1
i use this code to play an mp3 song:

Private Sub Dir1_Change()
On Error GoTo erro
File1 = Dir1
If Len(RTrim(LTrim(Dir1))) = 3 Then
Text1 = Dir1
Else
Text1 = RTrim(LTrim(Dir1 + ""))
End If
Exit Sub
erro:
MsgBox "Erro de acesso !", vbCritical
End Sub

Private Sub Drive1_Change()
On Error GoTo erro
Dir1 = Drive1
If Len(RTrim(LTrim(Dir1))) = 3 Then
Text1 = Dir1
Else
Text1 = RTrim(LTrim(Dir1 + ""))
End If
Exit Sub
erro:
MsgBox "Erro de acesso !", vbCritical
End Sub

**** i chose the mp3 directory i want *** and then ...

Private Sub File1_DblClick()
Label2.Caption = " Playing " & File1.List(File1.ListIndex)
MediaPlayer1.FileName = Text1 & File1.List(File1.ListIndex)
MediaPlayer1.Play
End Sub

**** the windows media player plays the music i DBL CLICK ****
-----------------------------------------------------------------
this code is OK if i want to play only one music.
my need is to play all the mp3 files,without stop, in the directory, when i DBL CLICK the File1 directory

how can i do this ?

Mediaplayer1 And Dvd
does anybody know how to play a dvd using the mediaplayer1 ?

i have took the controls of as i want to use nothing but code.

thanks
thingimijig.

Mediaplayer1
i use mediaplayer to play .wav files but i am listing more then one files in my listbox so what i like to do is when one file is finish playing it will goto the next file in listbox and play that file.

Mediaplayer1 Repeat
This is my code, and i dont get repeat to work.
I think i did something wrong with last code.



vb Code:
Option Explicit Private Sub Command1_Click() ' Browse button (works perfectly)    Me.CommonDialog1.Filter = "MP3 Files (*.mp3)|*.mp3|WAV Files (*.wav)|*.wav|MPG Movies (*.mpg)|*.mpg|AVI Movies (*.avi)|*.avi"    Me.CommonDialog1.ShowOpen    If Me.CommonDialog1.FileName <> "" Then        Me.MediaPlayer1.FileName = Me.CommonDialog1.FileName        Me.MediaPlayer1.Play    Else        MsgBox "Select a file first."    End IfEnd Sub Private Sub Command2_Click() ' Hides the window    music.HideEnd Sub  Private Sub command3_click() ' Changes caption when click repeat box    If (Command3.Caption = "Repeat (off)") Then        Command3.Caption = "Repeat (on)"    ElseIf (Command3.Caption = "Repeat (on)") Then        Command3.Caption = "Repeat (off)"    End IfEnd Sub Private Sub mediaplayer1_done() ' Should repeat, but wont work :SIf (Me.Command3.Caption = "Repeat (off)") Then    Me.MediaPlayer1.StopElseIf (Me.Command3.Caption = "Repeat (on)") Then    Me.MediaPlayer1.FileName = Me.CommonDialog1.FileName    Me.MediaPlayer1.PlayEnd IfEnd Sub


Thanks,
Marius

Need Help About MediaPlayer1 (the Control)
How can i SET a file in QUE if you understand...

Lets say i have a LISTBOX with files in,if i doubleclick any of them it will play it, but if i only choose one in the list (leftclick an item)
then it will play that song if i press the play button in the media control, just like in winamp!

If you choose a file,it does nothing, but if you press play while a file is choosen,then it will play that file...

Please help me out here...

MediaPlayer1.Duration
All aspects of my VB6 programs seem to work fine with Vista, after a bit of tweaking, but I can't get MediaPlayer1.Duration to work with vista. Does anyone have any suggestions? It doesn't produce an error - it just has a zero value...

MediaPlayer1.FileName
I'm not sure if this is the right forum to post this under but here goes.

I am working on an app that allows me to play an mp3 file on my desktop computer from my laptop. I have a server program runnning on the desktop machine and then a client app on the laptop. The client app connects to the server, makes a list of mp3 files, then to play a file I double click and item in the file listbox. this sends the full path of the file 'Winsock1.SendData "D:NathanMediaMusic" & List1.Text' where List1.Text = 'song.mp3'. This may sound pretty useless but the reason I want this is because I am sitting here at my laptop wanting to listen to music but the audio sucks on it, so I thought maybe I could make an app that lets me play a mp3 remotly.

Ok enough explaining why, now for the problem. The client is sending the data just fine and the server is recieving the data just fine but when I use 'MediaPlayer1.FileName = ind' it wont set a file name. Here is the ode for Winsock1_DataArrival:

Code:
Private Sub Winsock1_DataArrival(Index As Integer, ByVal bytesTotal As Long)
  Dim ind As String
  Winsock1(Index).GetData ind
  Label1.Caption = ind
  MediaPlayer1.FileName = ind
  If Not MediaPlayer1.FileName = "" Then MediaPlayer1.Play
End Sub


It's setting Label1.Caption but it wont set the .FileName. Any ideas on why this isn't working?




Edited by - CodeGeek on 4/5/2003 2:26:22 AM

Playing .avi In Form Using Mediaplayer1 Control
hi

i am using mmcontrol to play avi files in a picture box but it doesnt seem to play them correctly 1) i get no sound and 2) it plays in fast forward.

but i was told instead of using mmcontroller use mediplayer1 control

can anybody tell me the code to use it and how to make it play in a picture box or something as long as its on my form


cheers

Question About The MediaPlayer1.Duration Property
Is there anything I can do to make this property work without having to wait until the song begins playing?

How Can I Make It When I Click On A Path In A List Box It Opens As Mediaplayer1
I am making an mp3 jukebox which seaches for mp3s on my hardrive then lists the results in a list box
i can make a button play a specific mp3 by using
MediaPlayer1.Open "D:Dr. Dre - Forgot about DRE.mp3"
how can i use that code and have the path in the list box become the "D:Dr. Dre - Forgot about DRE.mp3"???

if u know of anything that will help me please tell me!

Copyright 2005-08 www.BigResource.com, All rights reserved