Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Setting "currentPositionTimecode" Not Working?

81 views
Skip to first unread message

Joshua Anderson

unread,
Jan 14, 2003, 8:47:45 PM1/14/03
to
Hi,

I am trying to set "currentPositionTimecode" using media player 9 but it is
not working.

I have a wmv file, with embedded SMPTE timecode, using a timer object I can
retreive "currentPositionTimecode" sucessfully.

When I try and set it so that it will just go to that timecode, it passes
over the line sucessfully but nothing happens, the file continues to play
and nothing happens.

The other weird thing is that when I type mp1.controls, I do not get
currentpositiontimecode as an option in the dropdown, I get currentposition
and currentpositionstring but not currentpositiontimecode.

I am using Visual Basic 6, below is some code:

Private Sub Command1_Click()
MP1.Controls.currentPositionTimecode = "18:00:13:05"

End Sub

Private Sub Form_Load()
MP1.URL = "\\testmachine\test\PSC-WI0002-003.wmv"


MP1.Controls.currentPositionTimecode = "18:00:13:05"

End Sub

Private Sub Timer1_Timer()
Label1.Caption = MP1.Controls.currentPositionTimecode
End Sub


Any help is greatly appreciated.

thanks
joshua


Jim Travis [ms]

unread,
Jan 14, 2003, 9:23:52 PM1/14/03
to
When you call currentPositionTimecode in Form_Load, that won't work because
setting the URL is an asynchronous operation. So it isn't guaranteed that
the URL is set before you make the timecode call.

The currentPositionTimecode property is on the IWMPControls3 interface. I'd
like to point you to this section of the Playe SDK:

http://msdn.microsoft.com/library/en-us/wmplay/mmp_sdk/usingwindowsmediaplay
erwithvisualbasic.asp?frame=true

and ask you to pay particular attention to the part about multiple
interfaces. I think that might just solve your problem.

If that doesn't work, let me know and I'll look into it further.

Thanks,


--
Jim Travis
Microsoft Corp.
Windows Media Player SDK

Please do not send email directly to this alias as this alias is for
newsgroup purposes only. This posting is provided "AS IS" with no
warranties, and confers no rights. You assume all risk for your use. © 2003
Microsoft Corporation. All rights reserved.


"Joshua Anderson" <jo...@mastermind.net.au> wrote in message
news:epq9FgDvCHA.572@TK2MSFTNGP12...

Joshua Anderson

unread,
Jan 14, 2003, 9:57:15 PM1/14/03
to
Hi Jim,

Thanks for your reply, I understand now why I could not see
currentpositiontimecode in the dropdown, and I have modified the code as
follows:

I also understand why I could not set the "currentpositiontimecode" in
form_load, I was just doing this to see if it would work, I am really doing
this on a button when the file is playing or stopped.

I have added media player as a component, and drawn it on my form, and
renamed it to MP1. I assume thats all ok?


Dim controlsObject As IWMPControls3

Private Sub Form_Load()

MP1.URL = "c:\test\PSC-WI0002-003.wmv"
Set controlsObject = MP1.Controls

End Sub

Private Sub Command1_Click()

controlsObject.currentPositionTimecode = "18:00:13:05"

End Sub

Private Sub Timer1_Timer()
Label1.Caption = controlsObject.currentPositionTimecode
End Sub

I have tried stopping the player before going to the timecode, pausing etc
nothing works.

Thanks
josh

"Jim Travis [ms]" <jtr...@online.microsoft.com> wrote in message
news:OwRZW0DvCHA.2476@TK2MSFTNGP10...

Joshua Anderson

unread,
Jan 14, 2003, 11:12:35 PM1/14/03
to

Ok,

for anyone interested, her is how you do it:

currentPositionTimecode = "[00000]18:00:12.23"

I am not sure why you need "[00000]" but you do.

Also the frames has to be put in with a decimal place not a colon.

Hope that helps someone!


"Joshua Anderson" <jo...@mastermind.net.au> wrote in message

news:#c3B8GEvCHA.2296@TK2MSFTNGP10...

Jim Travis [ms]

unread,
Jan 15, 2003, 2:13:06 PM1/15/03
to

Joshua, thanks for bringing this issue to our attention. I'll see that the
documentation gets updated.

--

Jim Travis
Microsoft Corp.
Windows Media Player SDK

Please do not send email directly to this alias as this alias is for
newsgroup purposes only. This posting is provided "AS IS" with no
warranties, and confers no rights. You assume all risk for your use. © 2003
Microsoft Corporation. All rights reserved.

"Joshua Anderson" <jo...@mastermind.net.au> wrote in message

news:u1OSCxEvCHA.1656@TK2MSFTNGP09...

Jim Travis [ms]

unread,
Jan 15, 2003, 2:34:23 PM1/15/03
to

BTW, the [00000] is a range specifier. It's possible in a single .wmv file
to stitch together content from multiple "reels", each having a different
time code range. When you do this, presumably using the Format SDK, you
provide a range value for each "reel". This allows you to have discontinuous
time code from reel to reel.

Hope that clears it up.

--

Jim Travis
Microsoft Corp.
Windows Media Player SDK

Please do not send email directly to this alias as this alias is for
newsgroup purposes only. This posting is provided "AS IS" with no
warranties, and confers no rights. You assume all risk for your use. © 2003
Microsoft Corporation. All rights reserved.

"Joshua Anderson" <jo...@mastermind.net.au> wrote in message

news:u1OSCxEvCHA.1656@TK2MSFTNGP09...

Joshua Anderson

unread,
Jan 15, 2003, 6:18:57 PM1/15/03
to

Thanks for that,

I will look into that, because thats a problem we are having, I will look
into that, would be great to have discontinuous timecode in a single wmv
file, that is exactly what I was wanting to do!

thanks again
Joshua


"Jim Travis [ms]" <jtr...@online.microsoft.com> wrote in message

news:ejS2R0MvCHA.2060@TK2MSFTNGP11...

0 new messages