CurrentState Guesswork with Silverlight MediaElement
The Silverlight MediaElement control has an event CurrentStateChanged. If you’re building a Silverlight app that makes use of video this is crucial to being able to implement state logic. You may want some other UI elements to wait until a video is ready to play before they do their thing, for instance. The idea is that you listen for the event and when it’s fire you check the _mediaElement.CurrentState property to see what state it’s in. CurrentState will be a value like Buffering, Paused, Stopped, Playing etc.
Well annoyingly the CurrentState value isn’t always what it should be. I’ve worked with MediaElement a lot over the last few months and I’ve noticed that when a video finishes buffering its state could be any one of
- Stopped
- Paused
- Closed
- Opening
- Pondering
- Being coy
I guess that external factors like browser cache, video format and progressive downloading might play a part but, come on, seriously, the runtime really should be providing the solutions or workarounds to these problems so that I don’t have to. In a lot of cases there simply is no workaround. Very aggravating indeed.

nice work. thanks
Luci Nylund
30 Jan 10 at 10:15 am edit_comment_link(__('Edit', 'sandbox'), ' ', ''); ?>
[...] IronRuby, Exasp…Ben Hall on Cucumber, IronRuby, Exasp…Luci Nylund on CurrentState Guesswork with Si…Silverlight MediaEle… on Silverlight [...]
Silverlight MediaElement Complaints and Grievances « No Free Time
21 Feb 10 at 12:00 pm edit_comment_link(__('Edit', 'sandbox'), ' ', ''); ?>