不知道这是否应该是一个单独的答案,但这是实际的答案和解决方案!
此代码引用 VideoLan VLC ActiveX 插件 - axvlc.dll 并且只需要一个空白表单 注意:通过引用添加,而不是通过组件 > 控件。
Dim vlcControl As Object
Dim WithEvents vlcPlayer As AXVLC.VLCPlugin2
Private Sub Form_Load()
Set vlcControl = Controls.Add("VideoLAN.VLCPlugin.2", "vlcControl")
vlcControl.Height = 6000
vlcControl.Width = 10000
vlcControl.Visible = True
Set vlcPlayer = vlcControl.object
' I haven't figured out how to get this to play local files...
vlcPlayer.playlist.Add ("http://url.com/video.mp4")
vlcPlayer.playlist.play
End Sub
Private Sub vlcPlayer_MediaPlayerPlaying()
Debug.Print "Playing"
End Sub
Private Sub vlcPlayer_MediaPlayerEndReached()
Debug.Print "Stopped"
End Sub
编辑:这是一个单独的示例,不需要参考:
此代码只需要一个空白表单和安装/注册的 VLC ActiveX 注意:您无权访问 VLC 事件触发器
Dim vlcControl As Object
Private Sub Form_Load()
Set vlcControl = Controls.Add("VideoLAN.VLCPlugin.2", "vlcControl")
vlcControl.Height = 6000
vlcControl.Width = 10000
vlcControl.Visible = True
' I haven't figured out how to get this to play local files...
vlcControl.object.playlist.Add ("http://url.com/video.mp4")
vlcControl.object.playlist.play
End Sub