开发者

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

开发者 https://www.devze.com 2023-02-06 01:42 出处:网络
I have added COM control AxWindowsMediaPlayer to form in vb.net. and just have following code Public Class Form1

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 lauch开发者_运维问答ed 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消