hi guys! how can i make a progress bar that corresponds to a video length and has a seeking function? for example is the progress bar of WMP. can u give me some starting point guys. thanks! any advice will be greatly appreciated. :)
Printable View
hi guys! how can i make a progress bar that corresponds to a video length and has a seeking function? for example is the progress bar of WMP. can u give me some starting point guys. thanks! any advice will be greatly appreciated. :)
look at .controls.
Don't really know why you want a progress bar, the WMP comes with one. But:
Set min of your progressbar to 0, and max to WindowsMediaPlayer1.currentMedia.duration
use a timer with interval set at, say 500 (1/2 second) (intially enabled = false
when you start your player, set the timer.enabled to true and move your progressbar with the WindowsMediaPlayer1.controls.currentPosition
IF you have trouble setting the progress max value to the duration (see above), use this code: (where WMP1 is MY control)
Dim oMedia As IWMPMedia
Set oMedia = WMP1.newMedia(Text1.Text)
Dim dDummy As Double
Dim dDuration As Double
dDummy = oMedia.duration
WMP1.currentMedia = oMedia
dDuration = WMP1.currentMedia.duration
WMP1.URL = Text1.Text
ProgressBar1.Min = 0
ProgressBar1.Max = dDuration
thanks guys for the ideas! it greatly helped me. BTW i did it by getting the total secs of the video and set it as the max value of the progress bar. that do the trick for me. just saying if ever someone might need help about this thing. :) cheers!