Results 1 to 5 of 5

Thread: [RESOLVED] WMP progress bar

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2012
    Posts
    47

    Resolved [RESOLVED] WMP progress bar

    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.

  2. #2
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: WMP progress bar

    look at .controls.

  3. #3
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,145

    Re: WMP progress bar

    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

  4. #4
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,145

    Re: WMP progress bar

    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

  5. #5

    Thread Starter
    Member
    Join Date
    Jun 2012
    Posts
    47

    Re: WMP progress bar

    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width