I don't know if anyone has a good link or ideas how to use a Wndows Media Player on a form. I can understand creating a path/URL for it, but is there a way to enlarge it? I have tried stretching it in design, but on opening and closing the form it shrinks again having a canvas area (similar appearance to paint app)
I have played with properties but cannot seem to find anything. Also, I don't know if it's beacause I have an open URL (ie no path), when I open the form the media player looks very strange as though other objects on the form are overlapping.
Thanks
Windows Media Player
-
- Administrator
- Posts: 78487
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Windows Media Player
You can use code in the On Open or On Load event of the form:
Height and width are specified in twips, where 1 inch = 1440 twips.
Code: Select all
Private Sub Form_Load()
With Me.WindowsMediaPlayer0
.Width = 6 * 1440
.Height = 5 * 1440
.Object.URL = "file://C:\Videos\Lion_seul.mpeg"
End With
End Sub
Best wishes,
Hans
Hans
-
- StarLounger
- Posts: 56
- Joined: 24 Jan 2012, 21:48
Re: Windows Media Player
Thanyou Hans, excellent.
There seems very little information easily found on using this control in Access. Best regards
There seems very little information easily found on using this control in Access. Best regards
-
- StarLounger
- Posts: 56
- Joined: 24 Jan 2012, 21:48
Re: Windows Media Player
Well I have a form, a Windows Media control sensibly sized, a Listbox providing URL 's of .mpg's. However everytime a list selection is made, the same picture (still) appears in the player, it momentarily says it's playing the video (shows name), but nothing moves . If I click on the start button on the control again it says momentarily it's playing but nothing moves?
Any clues? Thanks
Any clues? Thanks
-
- StarLounger
- Posts: 56
- Joined: 24 Jan 2012, 21:48
Re: Windows Media Player
Bit embarrasing, I went through the references to see if there were any relevant references to the media control, and tried the ActiveX objects library and now it's working. Sorry I should have checked a bit more before shouting help.
-
- StarLounger
- Posts: 56
- Joined: 24 Jan 2012, 21:48
Re: Windows Media Player
I Don't believe it, went back and opened the form and it's stopped working again, just shows a still image which does not change when selecting another URL in the listbox. Nothing moves, says it's playing, shows video title. ???
-
- Administrator
- Posts: 78487
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Windows Media Player
I don't think you need any special references. Code like this should work:
where lstVideos is the list box containing file names, C:\Videos\ is the folder containing the files, and wmpPlayer is the name of the Windows Media Player object.
Code: Select all
Private Sub lstVideos_Click()
Me.wmpPlayer.Object.URL = "C:\Videos\" & Me.lstVideos
End Sub
Best wishes,
Hans
Hans
-
- StarLounger
- Posts: 56
- Joined: 24 Jan 2012, 21:48
Re: Windows Media Player
Thankyou Hans for sorting out my wrongful postings.
I have found if I change the size settings of the WMP (I put the WMP sizes in the form open event), when I reopen the form the WMP is frozen, but if I change the size and then close and open Access it works perfectly from then on? I thought maybe it was a memory problem, the size causing a problem, however when it's working ok it lets me double click on the video and see it full screen.
So for the time being I'm moving on okay. One question, is there syntax for making it loop? Thanks
I have found if I change the size settings of the WMP (I put the WMP sizes in the form open event), when I reopen the form the WMP is frozen, but if I change the size and then close and open Access it works perfectly from then on? I thought maybe it was a memory problem, the size causing a problem, however when it's working ok it lets me double click on the video and see it full screen.
So for the time being I'm moving on okay. One question, is there syntax for making it loop? Thanks
-
- Administrator
- Posts: 78487
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Windows Media Player
A primitive way to make it play repeatedly:
Me.wmpPlayer.Object.settings.playCount = 1000
Me.wmpPlayer.Object.settings.playCount = 1000
Best wishes,
Hans
Hans
-
- StarLounger
- Posts: 56
- Joined: 24 Jan 2012, 21:48
Re: Windows Media Player
It might be primitive to you Hans, but it's perfect for me.
I thought it might have been impossible to overide once set, but selecting another clip starts it all off again nicely. So thankyou very much.
I thought it might have been impossible to overide once set, but selecting another clip starts it all off again nicely. So thankyou very much.
-
- NewLounger
- Posts: 1
- Joined: 15 Feb 2012, 06:52
Re: Windows Media Player
Sorry can't be of any help. You can Google it of course, for a lot of opinions.