States and Events
At any time, MediaElement
can be in one of the following states, revealed by its read-only CurrentState
property: Closed
, Opening
, Buffering
, Playing
, Paused
, or Stopped
. Closed
is the initial state. It transitions to Opening
after the source is set, but before MediaOpened
or MediaFailed
is raised. During this state, any calls to Play
, Pause
, or Stop
are queued until the media is opened. A CurrentStateChanged
event is raised for every state transition. A MediaEnded
event is raised once the content reaches the end and stops playback. This doesn’t get raised due to programmatic Stop
calls, and it never gets raised if the content is looping.
Whenever content is buffering or downloading (in the case of content from a remote server), ...
Get XAML Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.