Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27184

Media Player - Show Time Code

$
0
0
Hello All,

I am trying to make a video player for a project which seems to be quite a challenge when I came to a stage where I need to show a time code (sort of time stamp) in a label next to the video being played.

The function of the program is...The movie file name contains the recording start time of the movie file in the format "17:56:33_Camera01.avi". When I load the movie in the player using the URL and click play the movie plays. I use a timer to get the current position of the playback in seconds,minutes and hours using the below method in the timer tick sub.

Code:

        Dim PlayHour, PlayMin, PlaySec As Integer
        Dim iSecond As Double = AxWindowsMediaPlayer1.Ctlcontrols.currentPosition
        Dim iSpan As TimeSpan = TimeSpan.FromSeconds(iSecond)

        PlayHour = iSpan.Hours.ToString.PadLeft(2, "0"c)
        PlayMin = iSpan.Minutes.ToString.PadLeft(2, "0"c)
        PlaySec = iSpan.Seconds.ToString.PadLeft(2, "0"c)

My requirement is to dynamically set a time code in the label by adding the current position hour, minute and second to the recorded time of the movie.

For example the movie file will show the time code as 17:56:33" when loaded, when the playback begins the seconds,minutes and hours should start incrementing in accordance with the actual time of the playback.

Can any one please guide me in the right direction... I am breaking my head on this since quite some time and heading no where...

thanks,
putta

Viewing all articles
Browse latest Browse all 27184

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>