Help with media player controls in vba (timer)

sspreyer

Registered User.
Local time
Today, 02:52
Joined
Nov 18, 2013
Messages
251
hi , all

i have google' d the hell out of this haven't manage to find an answer here what i'm trying to do.


i have window media player on a form i wonder if its possible at certain time say 20sec in to the video @00:00:20 call a procedure to open another form or PDF etc...

just curious if this can be achieved

thanks in advance

shane :)
 
I don't know! I couldn't find anything applicable myself...

However I did find the object model here:-
Object Model Reference for Scripting
https://msdn.microsoft.com/en-us/library/windows/desktop/dd563945(v=vs.85).aspx

And the:- Player Object Here:-
https://msdn.microsoft.com/en-us/library/windows/desktop/dd564034(v=vs.85).aspx
I couldn't see any events that might be useful...

It might be an idea to search the C+ forums, and possibly the vb.net forums, you might discover the name of the relevant event...

Interestingly I have been setting up my new MS Access website using Mautic. Mautic has the ability to stick a "gate" in front of a YouTube video. In other words when the YouTube video gets to a certain number of seconds in its play, it will open up a sign-up form or some other means of pestering the user! These are called "Gated Videos" this information may provide you with an alternative search method....
 
Thanks, Uncle Gizmo

Sorry for the late reply. good news i found solution might not be neatest to some of you guru experts. This what i come up with... and it works!:D

Code:
Private Sub Form_Timer()
Dim MediaFormatTime As String
    Set MW = "YOUR CONTROLNAME".Object

MediaFormatTime = Format("YOUR CTL NAME".[B][COLOR="Red"]Object.Controls.currentPosition[/COLOR],[/B] "#,##0")

If MediaFormatTime = 6 Then
MsgBox "At 6 Sec Mark"
or any other task you would like to do 
End If

If MediaFormatTime = 14 Then
MsgBox "At 14 Sec Mark"
'or any other task you would like to do 
End If


End Sub

i set the form timer interval to 800 milliseconds so you catch every second.

Had to use format() because the seconds were counting like 8.23030 etc..... i believe the technical term is Doubled might be wrong lol but i formatted it so no decimal point. "#,##0"

also can create a unbound box and set to no boarder and background transparent. add below to timer

Code:
"TEXTBOXCTRLNAME".VALUE = Format("YOUR CTL NAME".[B][COLOR="Red"]Object.Controls.currentPosition[/COLOR],[/B] "#,##0")

makes a video run timer. :)

not that i have an application i need it for just want to see if its possible and doesn't seem any write up on VBA how to achieve it. loads of it on VB or Java forums.

may help someone :cool:


Shane
 
Thanks for posting your solution, very much appreciated...

Sent from my SM-G925F using Tapatalk
 
I don't know! I couldn't find anything applicable myself...

However I did find the object model here:-
Object Model Reference for Scripting
https://msdn.microsoft.com/en-us/library/windows/desktop/dd563945(v=vs.85).aspx

And the:- Player Object Here:-
https://msdn.microsoft.com/en-us/library/windows/desktop/dd564034(v=vs.85).aspx
I couldn't see any events that might be useful...

It might be an idea to search the C+ forums, and possibly the vb.net forums, you might discover the name of the relevant event...

Interestingly I have been setting up my new MS Access website using Mautic. Mautic has the ability to stick a "gate" in front of a YouTube video. In other words when the YouTube video gets to a certain number of seconds in its play, it will open up a sign-up form or some other means of pestering the user! These are called "Gated Videos" this information may provide you with an alternative search method....
Thanks @Uncle Gizmo It's an old post but just helped me solve my player problem, Just goes to show searching the forums works ;)
 

Users who are viewing this thread

Back
Top Bottom