Results 1 to 12 of 12

Thread: Windows Media Player Control

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    May 2007
    Location
    Merced
    Posts
    868

    Windows Media Player Control

    Ok I have 2 questions:

    Question 1:

    Is there a way where I can have two times in two captions i.e:

    Time1: 2:05 Time2 :3:05

    Is there a way where I can tell the Windows Media Player to open a file and play from the start time and stop at the second time?

    Question 2:

    Is there a way where I can get the current time of the movie playing and put it in a label ?

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    May 2007
    Location
    Merced
    Posts
    868

    Re: Windows Media Player Control

    Nothing?

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    May 2007
    Location
    Merced
    Posts
    868

    Re: Windows Media Player Control

    I want the move to start at "1:10" and I have:
    vb Code:
    1. MovieS.Controls.currentPosition = "0110"
    Why dosent this work?

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    May 2007
    Location
    Merced
    Posts
    868

    Re: Windows Media Player Control

    So can this be done with the media player control or do I have to look elsewhere?

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    May 2007
    Location
    Merced
    Posts
    868

    Re: Windows Media Player Control

    What is the proper way to declaring a start position and a ending position for the Windows Media Player Control? So when a button is pressed it gets the start position from a textbox and a timer will check the current position and compare the time to whats in another textbox and if the position is equal then the movie stops.

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    May 2007
    Location
    Merced
    Posts
    868

    Re: Windows Media Player Control

    Is there?

  7. #7
    Frenzied Member
    Join Date
    Nov 2005
    Posts
    1,834

    Re: Windows Media Player Control

    CurrentPosition must be in seconds. If you want it to start at "1:10", then you should set it to "70".

    vb Code:
    1. Private Sub Form_Load()
    2.     Text1.Text = "70" '1:10
    3.     Text2.Text = "90" '1:30
    4.     Timer1.Interval = 1000
    5.    
    6.     WindowsMediaPlayer1.Controls.currentPosition = Text1.Text
    7.     WindowsMediaPlayer1.URL = "C:\myvideo.avi"
    8. End Sub
    9.  
    10. Private Sub Timer1_Timer()
    11.     If WindowsMediaPlayer1.Controls.currentPosition >= Text2.Text Then
    12.         WindowsMediaPlayer1.Controls.stop
    13.     End If
    14. End Sub

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    May 2007
    Location
    Merced
    Posts
    868

    Re: Windows Media Player Control

    Thanks, thats exactly what I am looking for..Is there a way to seperate whats in the textbox? Lets say someone entered 1:10 is there a way to convert it over to 70 seconds?

  9. #9
    Frenzied Member
    Join Date
    Nov 2005
    Posts
    1,834

    Re: Windows Media Player Control

    You can do something like this, assuming the video isn't longer than 1 hour.

    MsgBox CDate("00:" & Text1.Text) * 86400

  10. #10

    Thread Starter
    Fanatic Member
    Join Date
    May 2007
    Location
    Merced
    Posts
    868

    Re: Windows Media Player Control

    Ok, thanks but what if the video is longer than 1 hour?

  11. #11

    Thread Starter
    Fanatic Member
    Join Date
    May 2007
    Location
    Merced
    Posts
    868

    Re: Windows Media Player Control

    Can the video be over an hour?

  12. #12
    Frenzied Member
    Join Date
    Nov 2005
    Posts
    1,834

    Re: Windows Media Player Control

    Yes, simply remove the "00:".

    MsgBox CDate(Text1.Text) * 86400

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