Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - MediaTimeline reports wrong timeline in Beta 2.

 
 
Old 06-28-2006   #1 (permalink)
Horus Liu


 
 

MediaTimeline reports wrong timeline in Beta 2.

Hi All,

I try to display playback time for video file using MediaTimeLine, but in
Beta 2 when
CurrentTimeInvalidated occured, the CurrentTime for mediaClock always will
be zero(00:00), is this a Beta 2 bug or the way I use MediaTimeLine is wrong?
The following code shows how I use MediaTImeLine:

mediaTimeLine = new MediaTimeline(new Uri(filePath,
UriKind.RelativeOrAbsolute));
mediaClock = this.mediaTimeLine.CreateClock();
mediaClock.CurrentTimeInvalidated += new
EventHandler(ClipCurrentTimeInvalidated);

and the following code shows how I handle CurrentTimeInvalidated:

void ClipCurrentTimeInvalidated(object sender, EventArgs e)
{
string ct = this.mediaClock.CurrentTime.ToString();

// Display current time.
}

and the string "ct" always is 00:00. Does any one know what's going on?
Any comments are appreciated, thanks!

Horus.


My System SpecsSystem Spec
Old 07-12-2006   #2 (permalink)
Ed Maia [MSFT]


 
 

Re: MediaTimeline reports wrong timeline in Beta 2.

You need to assign a MediaClock to either a MediaElement or a MediaPlayer's
Clock property in order to play media. It doesn't look like you are doing
that from the snippet below.

Thanks a lot,
Ed Maia
WPF PM

"Horus Liu" <Horus Liu@discussions.microsoft.com> wrote in message
news:FA02740C-6F29-40AF-AB79-0EF40E817C9C@microsoft.com...
> Hi All,
>
> I try to display playback time for video file using MediaTimeLine, but in
> Beta 2 when
> CurrentTimeInvalidated occured, the CurrentTime for mediaClock always will
> be zero(00:00), is this a Beta 2 bug or the way I use MediaTimeLine is
> wrong?
> The following code shows how I use MediaTImeLine:
>
> mediaTimeLine = new MediaTimeline(new Uri(filePath,
> UriKind.RelativeOrAbsolute));
> mediaClock = this.mediaTimeLine.CreateClock();
> mediaClock.CurrentTimeInvalidated += new
> EventHandler(ClipCurrentTimeInvalidated);
>
> and the following code shows how I handle CurrentTimeInvalidated:
>
> void ClipCurrentTimeInvalidated(object sender, EventArgs e)
> {
> string ct = this.mediaClock.CurrentTime.ToString();
>
> // Display current time.
> }
>
> and the string "ct" always is 00:00. Does any one know what's going on?
> Any comments are appreciated, thanks!
>
> Horus.
>



My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
Microsoft Beta Client reports appear here? Vista General
Looks like PT (from WinSuperSite.com) is wrong again, there is no sign of the Windows Vista Public Beta. Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46