Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

MediaTimeline reports wrong timeline in Beta 2.

Closed Thread
 
Thread Tools Display Modes
Old 06-28-2006   #1 (permalink)
Horus Liu
Guest


 

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.

Old 07-12-2006   #2 (permalink)
Ed Maia [MSFT]
Guest


 

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.
>



Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
MediaTimeline and Binding ShayEr Avalon 0 04-13-2008 04:37 AM
Microsoft Beta Client reports appear here? Peter Vista General 15 08-30-2006 02:25 PM
Looks like PT (from WinSuperSite.com) is wrong again, there is no sign of the Windows Vista Public Beta. Kevin John Panzke Vista General 3 05-28-2006 05:26 PM
MediaTimeline.VolumeRatio Jack Avalon 0 01-10-2006 03:52 PM
re: MediaTimeline.VolumeRatio robertwl@nospam.microsoft.com Avalon 0 01-10-2006 03:52 PM








Vistax64.com 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 2005-2008

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 47 48 49 50