I want to embed VLC video player into one of my Access forms so that users can select a video they have uploaded and play it within Access.
I found code from this website:
http://workingwithaccess2007.blogspot.co.uk/2013/10/vb-embedding-video-player-using-vlc.html
But the code which was given doesn't work now. It could be something to do with new updates in VLC which has caused the code to not work.
Dim player As VLCPlugin2
Set player = VLC.Object
Dim strURL As String
strURL = "C:\temp\1.mwv"
player.playlist.Add strURL
player.playlist.play
My main issue is that I tried embedding Windows Media Player initially and it caused Access to continuously crash which is why I'm seeking an alternative solution.
I've not used this before, so can't profess to be an expert, but I managed to get the player running when the form was opened.
Make sure you've got a reference set to the VLC plugin (Alt + F11 > Tools > References):
In design view on your form, go to the controls section and expand it so you can get at the Active X controls:
Select the v2 VLC control:
Select your form by putting a dot in the top-left:
Using an event to trigger playback (I used the Form_Current
event) put the code you used, but note 2 changes which I have commented:
Private Sub Form_Current()
Dim player As VLCPlugin2
Set player = Me.VLCPlugin22.Object ' <-- this should reference the VLC control you put on your form by name
Dim strURL As String
strURL = "File:///D:\videos\music\Radiohead - In Rainbows From The Basement [Live].avi" ' <-- this should start with File:///
player.playlist.Add strURL
player.playlist.play
End Sub
Then it should work... it does for me anyway :)