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 ?
Re: Windows Media Player Control
Re: Windows Media Player Control
I want the move to start at "1:10" and I have:
vb Code:
MovieS.Controls.currentPosition = "0110"
Why dosent this work?
Re: Windows Media Player Control
So can this be done with the media player control or do I have to look elsewhere?
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.
Re: Windows Media Player Control
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:
Private Sub Form_Load()
Text1.Text = "70" '1:10
Text2.Text = "90" '1:30
Timer1.Interval = 1000
WindowsMediaPlayer1.Controls.currentPosition = Text1.Text
WindowsMediaPlayer1.URL = "C:\myvideo.avi"
End Sub
Private Sub Timer1_Timer()
If WindowsMediaPlayer1.Controls.currentPosition >= Text2.Text Then
WindowsMediaPlayer1.Controls.stop
End If
End Sub
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?
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
Re: Windows Media Player Control
Ok, thanks but what if the video is longer than 1 hour?
Re: Windows Media Player Control
Can the video be over an hour?
Re: Windows Media Player Control
Yes, simply remove the "00:".
MsgBox CDate(Text1.Text) * 86400