When WMP is running in a VBA UserForm it sizes automatically based on clip size and resolution, irrespective of Width
and Height
properties being set programmatically. I need the video to have a fixed size. The following code does nothing:
With UserForm1.WindowsMediaPlayer1
.URL = "C:\AnyVideo.mp4"
.Controls.Play
.stretchToFit = True
.Width = 500
.Height = 300
.Top = 0
.Left = 0
End With
The following code does work but makes the video jumpy at the beginning - starts playing at its own size, then jumps to the new size, not a professional look.
With UserForm1.WindowsMediaPlayer1
.URL = "C:\AnyVideo.mp4"
.Controls.Play
End With
Timer_1 = Timer + 1
Do While Timer < Timer_1
DoEvents
Loop
With UserForm1.WindowsMediaPlayer1
.stretchToFit = True
.Width = 600
.Height = 300
.Top = 0
.Left = 0
End With
I've looked around and have found nothing to explain what's going on or to solve this. Anybody can help?