So basicly ive made a media player in vb using the windows media player control and everything is fine except that when i use the trackbar to navigate on a video it starts stopping and starting like a scratched cd (there is nothing wrong with the video file) strangely this does not happen whilst playing audio files the shaking stops if i pause it for a second ant then play it again but incorporating a pause in the trackbar function does not help. This the code i found on the internet but this produces the same result:
Try
If (PlayerControl.currentMedia.duration <> 0) Then
Dim NewPerc As Double = Convert.ToDouble(PlayBar.Value) / 100
Dim DurationVar As Integer = Convert.ToInt3 _(PlayerControl.currentMedia.duration * 1000) 'milliseconds
Dim NewPos As Integer = (DurationVar * NewPerc) / 1000
PlayerControl.Ctlcontrols.currentPosition = NewPos
Else
PlayBar.Value = 0
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
Im really stumped
can som1 help ?
Try
If (PlayerControl.currentMedia.duration <> 0) Then
Dim NewPerc As Double = Convert.ToDouble(PlayBar.Value) / 100
Dim DurationVar As Integer = Convert.ToInt3 _(PlayerControl.currentMedia.duration * 1000) 'milliseconds
Dim NewPos As Integer = (DurationVar * NewPerc) / 1000
PlayerControl.Ctlcontrols.currentPosition = NewPos
Else
PlayBar.Value = 0
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
Im really stumped