开发者

Building a progress bar for Silverlight MediaElement

I want a simple progress bar and a time label that shows the current position of the movie. Google gave me a few examples using Javascript: I really don't want to do that. The key thing开发者_StackOverflow社区 is to keep the progress bar and time updated througout the movie. Where can I find that event?


There is no event to hook into.

Instead user a Timer to periodically check MediaElement.Position for the MediaElement's current position and update your progress bar.

Something like:

private void timer_Tick(object sender, EventArgs e)
{
    TimeSpan currentPosition = Media1.Position;        
    this.Slider1.Value == currentPosition.TotalSeconds
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜