Click here to Skip to main content
15,895,656 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello
i got a litle problem in getting a avi and mp4 file to open and to be played on Axwindowmediaplayer1

i feel i got my code correct but maybe it is not, but here it is

Using ofd As New OpenFileDialog
ofd.Filter = "Video File Only (*.mp4*)|*.mp4*|(*.avi*)|*.avi*"
ofd.Title = "Select File"
ofd.Multiselect = False
If ofd.ShowDialog() = Windows.Forms.DialogResult.OK Then
AxWindowsMediaPlayer1.URL = OpenFileDialog1.FileName
End If
End Using

my aim is to make it open an mp4 or avi file and play it on the Axwindowmediaplayer1
thank in advance
Posted
Comments
Sergey Alexandrovich Kryukov 7-Jan-13 22:31pm    
First of all, don't post your answers as "Solution". I saw it: this is VB.NET. My advice: never call it VB. Who would like to answer the questions on VB?
—SA

1 solution

It won't play an mp4 if the codecs are not installed. If the avi is not raw, it won't play it, if the codecs are not installed. It won't start playing it unless auto play is set to true, without you calling the Play method of ( from memory ) the CtlControls class on the object.

Is this VB6 or VB.NET ?
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 7-Jan-13 22:31pm    
OP answered that this is VB.NET...
—SA
Christian Graus 7-Jan-13 22:32pm    
Thanks - it did not change the answer, but I thought it was worth pointing out it was not clear.

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