vaichidrewar
vaichidrewar

Reputation: 9621

In vb.net application AxWindowsMediaPlayer does not work on client machines

I have added COM control AxWindowsMediaPlayer to form in vb.net.

and just have following code

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        WMPlayerVideo.URL = "abase.mp4"
    End Sub

End Class

abase.mp4 file is kept in directory where exe is there. Every thing runs fine on dev m/c but on client machine application is not lauached.

When Interop.WMPLib.dll and Interop.WMPLib.dll are copied to the exe file directory then application is lauched at least but file is not played automatically and even on pressing play button its not played.

Is some dll registration required to make it work? or some references needed in project? or some changes on user machine?

Upvotes: 1

Views: 1926

Answers (1)

Hans Passant
Hans Passant

Reputation: 942267

Copying the DLLs is required, it cannot work otherwise. Which leaves the location of the file. You are only giving the relative location of the file, not the full path (like "c:\mumble\foo.mp4"). On your machine, this file needs to be stored in the bin\Debug folder of your project directory to make it work. Another machine you deploy your program to isn't going to have a bin\Debug (or Release) folder. It still needs to be present in the same directory as the EXE. Maybe you forgot to copy the .mp4 file?

Clearly you'll want to provide the user with a way to select the file. Use OpenFileDialog.

Upvotes: 1

Related Questions