开发者

Building a progress bar for Silverlight MediaElement

开发者 https://www.devze.com 2023-02-06 20:08 出处:网络
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开发者_StackOv

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

精彩评论

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

关注公众号