Click here to Skip to main content
13,139,496 members (60,213 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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 7-Jan-13 15:14pm
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?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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 ?
OP answered that this is VB.NET...
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170915.1 | Last Updated 7 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100