Code: Select all
Private strPlaylistURL As String
Public WithEvents vmpPreview As VBControlExtender
Private Sub UserControl_Initialize()
Set vmpPreview = Controls.Add("VideoLan.VLCPlugin.2", "vmpPreview")
vmpPreview.Visible = True
End Sub
Private Sub UserControl_Resize()
With vmpPreview
.Top = 0
.Left = 0
.Width = Width
.Height = Height
.ZOrder 1
End With
End Sub
Public Sub PlaylistPlay(strURL As String)
strPlaylistURL = strURL
With vmpPreview.object
.Playlist.Items.Clear
.Playlist.Add "file:///" + strURL
.Playlist.play
End With
End Sub
Public Sub PlaylistStop()
vmpPreview.object.Playlist.pause
volume = 100
vmpPreview.object.Playlist.stop
End Sub
Public Property Get volume() As Integer
volume = vmpPreview.object.volume
End Property
Public Property Let volume(nVolume As Integer)
vmpPreview.object.volume = nVolume
End Property
Public Property Get IsPlaying() As Boolean
IsPlaying = vmpPreview.object.Playlist.IsPlaying
End Property
Public Property Get PlaylistURL() As String
If IsPlaying Then
Dim nCurrentItem As Integer
nCurrentItem = vmpPreview.object.Playlist.currentItem
If nCurrentItem > -1 Then PlaylistURL = strPlaylistURL
End If
End Property
End Sub