Export (0) Print
Expand All

MediaEnded

Silverlight

Occurs when a MediaElement object is no longer playing audio or video.

<object MediaEnded="eventhandlerFunction"  .../>
[token = ]object.AddEventListener("MediaEnded", eventhandlerFunction)

AddEventListener Parameters

token

integer

A token that is returned from the function, which you can optionally retain as a variable. If you intend to call RemoveEventListener to remove the handler, you will need this token.

eventhandlerFunction

object

The name of your event handler function as it is defined in script. When used as an AddEventListener parameter, quotation marks around the function name are not required. (See the "Remarks" section.)

Event Handler Parameters

sender

object

The object that invoked the event.

eventArgs

object

This parameter is always set to null.

You can also add handlers in script by using a quoted string for the event handler name, as follows:

object.AddEventListener("MediaEnded", "eventhandlerFunction")

This syntax also returns a token. However, the token is not an absolute requirement for removing the handler in cases where the handler was added by using a quoted string. For details, see RemoveEventListener.

If the media file contains multiple streams, the MediaEnded event will occur after the last stream has ended.

The MediaEnded event does not occur if media playback is controlled interactively. The event that calls the Stop method can be used for end-of-media tasks.

Community Additions

ADD
Show:
© 2014 Microsoft