View Full Version : VB6: MediaPlayer
Phlenix
Feb 6th 2008, 11:54 am
How can i load a file in the mediaplayer with a openfile dialog?
Could someone please gove me a code?
Phlenix
Feb 7th 2008, 8:49 am
anyone?:confused:
nhl4000
Feb 7th 2008, 2:36 pm
Try searching some tutorials on Google, Google is your best bet.
urstop
Feb 8th 2008, 3:47 am
Using the opendialog, you can get the path of the file to be opened. Use this path of the file with the media player control and use the play menthod of the media player to play the file.
Phlenix
Feb 8th 2008, 9:11 am
I know but everytime i use the name of the mediaplayer it says that its not declared or so. why should i declare that???
nhl4000
Feb 8th 2008, 6:24 pm
http://www.vb-helper.com/howto_net_play_audio_media_player.html
Phlenix
Feb 9th 2008, 2:21 am
Finally i did it. But always when i debug my program is says something like "exeption" und "hresult".What am i doing wrong? Heres my code:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Button1.Enabled = False
AxMediaPlayer1.Visible = False
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
AxMediaPlayer1.launchURL(OpenFileDialog1.FileName)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
OpenFileDialog1.ShowDialog()
Button1.Enabled = True
End Sub
End Class
PLease help
nhl4000
Feb 9th 2008, 11:18 am
Which line?
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.